snic: Fix use-after-free in case of a dma mapping error
authorJohannes Thumshirn <jthumshirn@suse.de>
Thu, 23 Jun 2016 12:37:20 +0000 (14:37 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 13 Jul 2016 03:16:31 +0000 (23:16 -0400)
commit2a6a20ea7d894464ca6bd402058c1aadf796a48c
tree149a1250c52c19c843c9651413a94f6de53fa9aa
parent40e4c0a4e1d5414ed33e5bc846a832dc868fa65d
snic: Fix use-after-free in case of a dma mapping error

If there is a dma mapping error snic kfree()s buf right before printing
it.  Change the order to not accidently trip on memory that's not owned
by us anymore.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: Narsimhulu Musini <nmusini@cisco.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/snic/snic_disc.c