]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lpfc: fix memory leak and NULL dereference
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Wed, 23 Sep 2015 13:32:32 +0000 (19:02 +0530)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 26 Feb 2016 02:37:53 +0000 (18:37 -0800)
commita30ce37127c9102f8daac16fd3b8ceb03acb1f16
tree322d925d9ab8d62e43b76cedb5b20867cde0f1ed
parent010edd332c596d7824d792db28b48d8ef3dd68c7
lpfc: fix memory leak and NULL dereference

Orabug: 22493326

kmalloc() can return NULL and without checking we were dereferencing it.
Moreover if kmalloc succeeds but the function fails in other parts then
we were returning the error code but we missed freeing lcb_context.
While at it fixed one related checkpatch warning.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: James Smart <james.smart@avagotech.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit e79504236548e4c909959ba444f87a12224555ac)

Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
drivers/scsi/lpfc/lpfc_els.c