All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] cifs: cache dirent names for cached directories
@ 2022-05-05 10:32 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2022-05-05 10:32 UTC (permalink / raw)
  To: lsahlber; +Cc: linux-cifs

Hello Ronnie Sahlberg,

This is a semi-automatic email about new static checker warnings.

The patch 4cfa6d6563b6: "cifs: cache dirent names for cached
directories" from May 3, 2022, leads to the following Smatch
complaint:

    fs/cifs/smb2ops.c:796 open_cached_dir()
    warn: variable dereferenced before check 'tcon' (see line 780)

fs/cifs/smb2ops.c
   779	{
   780		struct cifs_ses *ses = tcon->ses;
                                       ^^^^^^^^^
Dereference

   781		struct TCP_Server_Info *server = ses->server;
   782		struct cifs_open_parms oparms;
   783		struct smb2_create_rsp *o_rsp = NULL;
   784		struct smb2_query_info_rsp *qi_rsp = NULL;
   785		int resp_buftype[2];
   786		struct smb_rqst rqst[2];
   787		struct kvec rsp_iov[2];
   788		struct kvec open_iov[SMB2_CREATE_IOV_SIZE];
   789		struct kvec qi_iov[1];
   790		int rc, flags = 0;
   791		__le16 utf16_path = 0; /* Null - since an open of top of share */
   792		u8 oplock = SMB2_OPLOCK_LEVEL_II;
   793		struct cifs_fid *pfid;
   794		struct dentry *dentry;
   795	
   796		if (tcon == NULL || tcon->nohandlecache ||
                    ^^^^^^^^^^^^
The patch adds a new NULL check, but too late.

   797		    is_smb1_server(tcon->ses->server))
   798			return -ENOTSUPP;

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-05 10:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-05 10:32 [bug report] cifs: cache dirent names for cached directories Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.