From ba9e5874b2f4a191cdd9de8a7ea96344458c1ab7 Mon Sep 17 00:00:00 2001 From: Tomas Henzl Date: Sun, 16 Nov 2014 14:35:33 +0100 Subject: [PATCH] esas2r: fix an error path in esas2r_ioctl_handler Is seems strange to manipulate nvram_semaphore when in this place, this patch fixes it. Signed-off-by: Tomas Henzl Acked-by: Bradley Grove Signed-off-by: Christoph Hellwig --- drivers/scsi/esas2r/esas2r_ioctl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/esas2r/esas2r_ioctl.c b/drivers/scsi/esas2r/esas2r_ioctl.c index 9ac82075546a..c88b9f9491b5 100644 --- a/drivers/scsi/esas2r/esas2r_ioctl.c +++ b/drivers/scsi/esas2r/esas2r_ioctl.c @@ -1420,9 +1420,10 @@ int esas2r_ioctl_handler(void *hostdata, int cmd, void __user *arg) rq = esas2r_alloc_request(a); if (rq == NULL) { - up(&a->nvram_semaphore); - ioctl->data.prw.code = 0; - break; + kfree(ioctl); + esas2r_log(ESAS2R_LOG_WARN, + "could not allocate an internal request"); + return -ENOMEM; } code = esas2r_write_params(a, rq, -- 2.39.5