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>