[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <92a56e39-6472-415c-0fa6-e2786b006f98@users.sourceforge.net>
Date: Thu, 8 Dec 2016 12:35:50 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: devel@...verdev.osuosl.org, Chris Cesare <chris.cesare@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
H Hartley Sweeten <hsweeten@...ionengravers.com>,
Ian Abbott <abbotti@....co.uk>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 3/5] staging: comedi: usbdux: Move an assignment in
usbdux_alloc_usb_buffers()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 8 Dec 2016 10:13:56 +0100
Move one assignment for the local variable "usb" so that its setting
will only be performed after some memory allocations succeeded
by this function.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/staging/comedi/drivers/usbdux.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c
index d7d683bd669c..7efeac71161b 100644
--- a/drivers/staging/comedi/drivers/usbdux.c
+++ b/drivers/staging/comedi/drivers/usbdux.c
@@ -1446,7 +1446,7 @@ static int usbdux_firmware_upload(struct comedi_device *dev,
static int usbdux_alloc_usb_buffers(struct comedi_device *dev)
{
- struct usb_device *usb = comedi_to_usb_dev(dev);
+ struct usb_device *usb;
struct usbdux_private *devpriv = dev->private;
struct urb *urb;
int i, x;
@@ -1473,6 +1473,7 @@ static int usbdux_alloc_usb_buffers(struct comedi_device *dev)
if (!devpriv->ao_urbs)
goto free_ai_urbs;
+ usb = comedi_to_usb_dev(dev);
for (i = 0; i < devpriv->n_ai_urbs; i++) {
/* one frame: 1ms */
urb = usb_alloc_urb(1, GFP_KERNEL);
--
2.11.0
Powered by blists - more mailing lists