From: Jesper Juhl Date: Fri, 27 Jan 2012 23:23:41 +0000 (+0100) Subject: [SCSI] bfa: don't leak mem in bfad_im_bsg_els_ct_request() X-Git-Tag: v3.4-rc1~145^2~131 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64b8aa75bc101eb73e2c76a66fb5432b4c83ffb2;p=pandora-kernel.git [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: Jesper Juhl Acked-by: Krishna Gudipati Signed-off-by: James Bottomley --- Reading git-diff-tree failed