]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scsi: libfc: free skb when receiving invalid flogi resp
authorMing Lu <ming.lu@citrix.com>
Thu, 24 Jan 2019 05:25:42 +0000 (13:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Mar 2019 21:03:15 +0000 (14:03 -0700)
commit6487e6b6d494175e1c729d13dc27e23276d8bd2c
tree819e5cd381b579306f32f3e3201de3f8cdd98cb3
parentfa46a54c8c8d3103886354e2433e445196499bf3
scsi: libfc: free skb when receiving invalid flogi resp

[ Upstream commit 5d8fc4a9f0eec20b6c07895022a6bea3fb6dfb38 ]

The issue to be fixed in this commit is when libfc found it received a
invalid FLOGI response from FC switch, it would return without freeing the
fc frame, which is just the skb data. This would cause memory leak if FC
switch keeps sending invalid FLOGI responses.

This fix is just to make it execute `fc_frame_free(fp)` before returning
from function `fc_lport_flogi_resp`.

Signed-off-by: Ming Lu <ming.lu@citrix.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/libfc/fc_lport.c