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: NSudip Mukherjee <sudip@vectorindia.org> Reviewed-by: NJames Smart <james.smart@avagotech.com> Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
Showing
想要评论请 注册 或 登录