xen-scsifront: Add a missing call to kfree
authorQuentin Lambert <lambert.quentin@gmail.com>
Sat, 19 Nov 2016 18:22:56 +0000 (19:22 +0100)
committerJuergen Gross <jgross@suse.com>
Thu, 24 Nov 2016 08:23:14 +0000 (09:23 +0100)
Most error branches following the call to kmalloc contain
a call to kfree. This patch add these calls where they are
missing.

This issue was found with Hector.

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/scsi/xen-scsifront.c

index 7e817c64f385135dd8c0a51e08fecbf2ecd3cace..c01316c6c7b131b56057940566c0d4ac72ba06c8 100644 (file)
@@ -627,6 +627,7 @@ static int scsifront_action_handler(struct scsi_cmnd *sc, uint8_t act)
 
        if (scsifront_enter(info)) {
                spin_unlock_irq(host->host_lock);
+               kfree(shadow);
                return FAILED;
        }