cifs: fix error handling when cifscreds key payload is an error
Subsystems (2)
PATCH 1/1 cifs: fix error handling when cifscreds key payload is an error
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Jeff Layton <[email protected]>
--- fs/cifs/connect.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/cifs/connect.c +1 -1
@@ -2125,7 +2125,7 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses)down_read (&key->sem); upayload = key->payload.data;if (IS_ERR_OR_NULL (upayload)) { - rc =PTR_ERR (key); + rc = upayload ?PTR_ERR (upayload) : -EINVAL ; goto out_key_put; }
Signature · 1 line
1.7.7.5
A message that is not in the archive (sent off-list or not yet received): 1327064677-15896-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Looks reasonable. Was this found by static code analysis?
Quoted 22 lines · Jeff Layton
Reported-by Dan Carpenter <[email protected]>Signed-off-by Jeff Layton <[email protected]>---
fs/cifs/connect.c | 2 +-1 files changed, 1 insertions(+), 1 deletions(-)fs/cifs/connect.c +1
-2@@ -2125,7 +2125,7 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses) down_read(&key->sem); upayload = key->payload.data; if (IS_ERR_OR_NULL(upayload)) { - rc = PTR_ERR(key); + rc = upayload ? PTR_ERR(upayload) : -EINVAL; goto out_key_put; } --1.7.7.5
Signature · 3 lines
Thanks, Steve
A message that is not in the archive (sent off-list or not yet received): CAH2r5mtTtYzj5MJXc5pu3L+cKO1XKrrcx6=gr8W_874sYPzfnw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 2 lines · Steve French
Looks reasonable. Was this found by static code analysis?
I saw this in reading the code for something else. But it should be a static checker thing, definitely. I'm writing a check for that now.
regards,
dan carpenter