]> git.baikalelectronics.ru Git - kernel.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)
committerJames Bottomley <JBottomley@Odin.com>
Tue, 10 Nov 2015 01:08:03 +0000 (17:08 -0800)
commitff4251c764701963a6677f28a78d20cd90ef63fe
tree645f887cadd3c3fefd4c697d83a2d3c0dc3be9af
parent7bc903c76abc850e8125f108141d6e5f0de3829f
lpfc: fix memory leak and NULL dereference

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>
drivers/scsi/lpfc/lpfc_els.c