diff mbox

CIFS: fix sha512 check in cifs_crypto_secmech_release

Message ID 20180219171113.GA16636@embeddedgus (mailing list archive)
State New, archived
Headers show

Commit Message

Gustavo A. R. Silva Feb. 19, 2018, 5:11 p.m. UTC
It seems this is a copy-paste error and that the proper variable to use
in this particular case is _sha512_ instead of _md5_.

Addresses-Coverity-ID: 1465358 ("Copy-paste error")
Fixes: 1c6614d229e7 ("CIFS: add sha512 secmech")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 fs/cifs/cifsencrypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gustavo A. R. Silva Feb. 19, 2018, 6:13 p.m. UTC | #1
Hi Aurélien,

On 02/19/2018 11:27 AM, Aurélien Aptel wrote:
> "Gustavo A. R. Silva" <gustavo@embeddedor.com> writes:
>> It seems this is a copy-paste error and that the proper variable to use
>> in this particular case is _sha512_ instead of _md5_.
> 
> *sigh* I re-read this a lot yet still missed it. Minor memory leak
>   fixed, good coverity catch and thanks for the fix!
> 
> Reviewed-by: Aurelien Aptel <aaptel@suse.com>
> 

Glad to help. Thanks for the review.

BTW I think this should be sent to stable too.
--
Gustavo
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve French Feb. 19, 2018, 10:09 p.m. UTC | #2
merged into cifs-2.6.git for-next

On Mon, Feb 19, 2018 at 12:13 PM, Gustavo A. R. Silva
<garsilva@embeddedor.com> wrote:
> Hi Aurélien,
>
> On 02/19/2018 11:27 AM, Aurélien Aptel wrote:
>>
>> "Gustavo A. R. Silva" <gustavo@embeddedor.com> writes:
>>>
>>> It seems this is a copy-paste error and that the proper variable to use
>>> in this particular case is _sha512_ instead of _md5_.
>>
>>
>> *sigh* I re-read this a lot yet still missed it. Minor memory leak
>>   fixed, good coverity catch and thanks for the fix!
>>
>> Reviewed-by: Aurelien Aptel <aaptel@suse.com>
>>
>
> Glad to help. Thanks for the review.
>
> BTW I think this should be sent to stable too.
> --
> Gustavo
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index 6fa6d45..a6ef088 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -829,7 +829,7 @@  cifs_crypto_secmech_release(struct TCP_Server_Info *server)
 		server->secmech.md5 = NULL;
 	}
 
-	if (server->secmech.md5) {
+	if (server->secmech.sha512) {
 		crypto_free_shash(server->secmech.sha512);
 		server->secmech.sha512 = NULL;
 	}