Skip to content
Commit 64b8aa75 authored by Jesper Juhl's avatar Jesper Juhl Committed by James Bottomley
Browse files

[SCSI] bfa: don't leak mem in bfad_im_bsg_els_ct_request()



If 'drv_fcxp = kzalloc(sizeof(struct bfad_fcxp), GFP_KERNEL);' fails
and returns NULL, then we'll leak the memory allocated to 'bsg_fcpt'
when we jump to 'out:' and the variable subsequently goes out of
scope.

Also remove the cast of the kzalloc() return value. kzalloc() returns
a void* which is implicitly converted, so the explicit cast is
pointless.

Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
Acked-by: default avatarKrishna Gudipati <kgudipat@brocade.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent e5cc6aa4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment