login
Header Space

 
 

Re: cifs_mount() contains strange code

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Adrian Bunk <bunk@...>
Cc: <sfrench@...>, <linux-cifs-client@...>, <linux-kernel@...>
Date: Thursday, March 27, 2008 - 5:53 pm

On Thu, Mar 27, 2008 at 07:34:58PM +0200, Adrian Bunk wrote:
 > This looks somehow fishy (note the "rc" settings):
 > 
 > <--  snip  -->
 > 
 > ...
 > int
 > cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
 >            char *mount_data, const char *devname)
 > {
 > ...
 >                                 /* BB check if this works for exactly length
 >                                  * three strings */
 >                                 if ((strchr(volume_info.UNC + 3, '\\') == NULL)
 >                                     && (strchr(volume_info.UNC + 3, '/') ==
 >                                         NULL)) {
 >                                         rc = connect_to_dfs_path(xid, pSesInfo,
 >                                                 "", cifs_sb->local_nls,
 >                                                 cifs_sb->mnt_cifs_flags &
 >                                                   CIFS_MOUNT_MAP_SPECIAL_CHR);
 >                                         rc = -ENODEV;
 >                                         goto out;
 > 
 > <--  snip  -->

I've noticed a bunch of things like that from time to time, and wondered
how useful it would be to have sparse warn on double assignments of variables
without a read inbetween.

	Dave

-- 
http://www.codemonkey.org.uk
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
cifs_mount() contains strange code, Adrian Bunk, (Thu Mar 27, 1:34 pm)
Re: cifs_mount() contains strange code, Dave Jones, (Thu Mar 27, 5:53 pm)
speck-geostationary