scsi: libfc: Free skb in fc_disc_gpn_id_resp() for valid cases
authorJaved Hasan <jhasan@marvell.com>
Wed, 29 Jul 2020 08:18:23 +0000 (01:18 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Aug 2020 08:29:56 +0000 (10:29 +0200)
commit9b5681afc9e69f7cacd769c7274f1d2a102257f7
treebbbb14cbba6c0ecf529c17fc0aeb225c577ec81f
parent8281409d9ed37045a2e54411d03316590e2f663a
scsi: libfc: Free skb in fc_disc_gpn_id_resp() for valid cases

[ Upstream commit ec007ef40abb6a164d148b0dc19789a7a2de2cc8 ]

In fc_disc_gpn_id_resp(), skb is supposed to get freed in all cases except
for PTR_ERR. However, in some cases it didn't.

This fix is to call fc_frame_free(fp) before function returns.

Link: https://lore.kernel.org/r/20200729081824.30996-2-jhasan@marvell.com
Reviewed-by: Girish Basrur <gbasrur@marvell.com>
Reviewed-by: Santosh Vernekar <svernekar@marvell.com>
Reviewed-by: Saurav Kashyap <skashyap@marvell.com>
Reviewed-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Javed Hasan <jhasan@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/libfc/fc_disc.c