From: Su Hui <suhui@nfschina.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: sfrench@samba.org, pc@manguebit.com, lsahlber@redhat.com,
sprasad@microsoft.com, tom@talpey.com,
linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] cifs: avoid possible NULL dereference
Date: Tue, 26 Sep 2023 09:20:50 +0800 [thread overview]
Message-ID: <8c2f8756-be5c-e2b3-e1a8-d2751a4531a0@nfschina.com> (raw)
In-Reply-To: <1ae6c204-ed00-4626-8246-32d66ae7e232@kadam.mountain>
On 2023/9/25 23:07, Dan Carpenter wrote:
> On Mon, Sep 25, 2023 at 12:52:21PM +0800, Su Hui wrote:
>> diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c
>> index 2108b3b40ce9..37eed057ded0 100644
>> --- a/fs/smb/client/file.c
>> +++ b/fs/smb/client/file.c
>> @@ -4878,6 +4878,12 @@ void cifs_oplock_break(struct work_struct *work)
>> struct cifsFileInfo *cfile = container_of(work, struct cifsFileInfo,
>> oplock_break);
>> struct inode *inode = d_inode(cfile->dentry);
>> +
>> + if (!inode) {
>> + cifs_dbg(FYI, "%s : failed to find inode\n", __func__);
>> + return;
>> + }
>> +
> Are we allowing this in the middle of the declaration block these days?
Really sorry for this, I will modify it right now.
Thanks for your reminder!
Su Hui
>
>> struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
>> struct cifsInodeInfo *cinode = CIFS_I(inode);
>> struct cifs_tcon *tcon;
>
> regards,
> dan carpenter
prev parent reply other threads:[~2023-09-26 1:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 4:52 Su Hui
2023-09-25 15:07 ` Dan Carpenter
2023-09-26 1:20 ` Su Hui [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8c2f8756-be5c-e2b3-e1a8-d2751a4531a0@nfschina.com \
--to=suhui@nfschina.com \
--cc=dan.carpenter@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lsahlber@redhat.com \
--cc=pc@manguebit.com \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.org \
--cc=sprasad@microsoft.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®