cifs: change && to ||
PATCH 1/1 cifs: change && to ||
This is a typo, if pvolume_info were NULL it would oops.
This function is used in clean up and error handling. The current code never passes a NULL pvolume_info, but it could pass a NULL *pvolume_info if the kmalloc() failed.
fs/cifs/connect.c +1 -1
@@ -2262,7 +2262,7 @@ cleanup_volume_info(struct smb_vol **pvolume_info) {struct smb_vol *volume_info; -if (!pvolume_info && !*pvolume_info) +if (!pvolume_info || !*pvolume_info)return ; volume_info = *pvolume_info;
Quoted 13 lines · On Mon, 26 Apr 2010 12:10:06 +0200 Dan Carpenter <[email protected]> wrote:
This is a typo, if
pvolume_infowere NULL it would oops.This function is used in clean up and error handling. The current code never passes a NULL
pvolume_info, but it could pass a NULL*pvolume_infoif thekmalloc()failed.Signed-off-by Dan Carpenter <[email protected]>fs/cifs/connect.c +0
-0
fs/cifs/connect.c cleanup_volume_info(struct smb_vol **pvolume_info) · line 2268
Quoted 8 lines
fs/cifs/connect.c +1
-1@@ -2262,7 +2262,7 @@ cleanup_volume_info(struct smb_vol **pvolume_info) {struct smb_vol *volume_info; -if (!pvolume_info && !*pvolume_info) +if (!pvolume_info || !*pvolume_info)return ; volume_info = *pvolume_info;
Good catch. I wonder though whether we can just eliminate that check altogether? In any case, this is clearly correct in the short term.
Quoted 19 lines · Jeff Layton
Quoted 16 lines · On Mon, 26 Apr 2010 12:10:06 +0200 Dan Carpenter <[email protected]> wrote:
This is a typo, if
pvolume_infowere NULL it would oops.This function is used in clean up and error handling. The current code never passes a NULL
pvolume_info, but it could pass a NULL*pvolume_infoif thekmalloc()failed.Signed-off-by Dan Carpenter <[email protected]>fs/cifs/connect.c +0
-0@@ -2262,7 +2262,7 @@ cleanup_volume_info(struct smb_vol **pvolume_info) {struct smb_vol *volume_info;
Quoted 8 lines
fs/cifs/connect.c cleanup_volume_info(struct smb_vol **pvolume_info) · line 2268
Quoted 5 lines
fs/cifs/connect.c +1
-1-if (!pvolume_info && !*pvolume_info) +if (!pvolume_info || !*pvolume_info)return ; volume_info = *pvolume_info;Good catch. I wonder though whether we can just eliminate that check altogether? In any case, this is clearly correct in the short term.
Nah, we can't. If the kmalloc() that allocates *pvolume_info fails it would lead to an OOPs.
regards,
dan carpenter
Quoted 2 lines
Acked-by Jeff Layton <[email protected]>
Quoted 6 lines · Dan Carpenter
Quoted 5 lines · Jeff Layton
Quoted 2 lines · On Mon, 26 Apr 2010 12:10:06 +0200 Dan Carpenter <[email protected]> wrote:
This is a typo, if
pvolume_infowere NULL it would oops.
Quoted 8 lines
Quoted 2 lines
Good catch. I wonder though whether we can just eliminate that check altogether? In any case, this is clearly correct in the short term.
Nah, we can't. If the
kmalloc()that allocates*pvolume_infofails it would lead to an OOPs.regards,
dan carpenter
Merged.
Signature · 7 lines
Thanks, Steve -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html