[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1451943701-18212-2-git-send-email-mina86@mina86.com>
Date: Mon, 4 Jan 2016 22:41:38 +0100
From: Michal Nazarewicz <mina86@...a86.com>
To: Felipe Balbi <balbi@...com>, "Du, Changbin" <changbin.du@...el.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Al Viro <viro@...iv.linux.org.uk>,
Robert Baldyga <r.baldyga@...sung.com>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
Michal Nazarewicz <mina86@...a86.com>
Subject: [PATCH 2/5] usb: f_fs: fix ffs_epfile_io returning success on req alloc failure
In the AIO path, if allocating of a request failse, the function simply
goes to the error_lock path whose end result is returning value of ret.
However, at this point ret’s value is zero (assigned as return value from
ffs_mutex_lock).
Fix by adding ‘ret = -ENOMEM’ statement.
Signed-off-by: Michal Nazarewicz <mina86@...a86.com>
---
drivers/usb/gadget/function/f_fs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index d1a4a86..1384220 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -793,8 +793,10 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
if (io_data->aio) {
req = usb_ep_alloc_request(ep->ep, GFP_KERNEL);
- if (unlikely(!req))
+ if (unlikely(!req)) {
+ ret = -ENOMEM;
goto error_lock;
+ }
req->buf = data;
req->length = data_len;
--
2.6.0.rc2.230.g3dd15c0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists