aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-10-25 12:56:32 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-25 14:11:19 -0400
commit28c3ae9a8cf45f439c9a0779ebd0256e2ae72813 (patch)
treef9d9ea23d793f28baa76b0662f86fc367f1381d6 /drivers/usb
parent961be09e1ead58509ed4bed0d5819a15d8613d8d (diff)
USB: mos7840: remove NULL-urb submission
The private int_urb is never allocated so the submission from the control completion handler will always fail. Remove this odd piece of broken code. Signed-off-by: Johan Hovold <jhovold@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/mos7840.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index c5e5a6c8d69e..f2c4bb709747 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -218,7 +218,6 @@ struct moschip_port {
218 int port_num; /*Actual port number in the device(1,2,etc) */ 218 int port_num; /*Actual port number in the device(1,2,etc) */
219 struct urb *write_urb; /* write URB for this port */ 219 struct urb *write_urb; /* write URB for this port */
220 struct urb *read_urb; /* read URB for this port */ 220 struct urb *read_urb; /* read URB for this port */
221 struct urb *int_urb;
222 __u8 shadowLCR; /* last LCR value received */ 221 __u8 shadowLCR; /* last LCR value received */
223 __u8 shadowMCR; /* last MCR value received */ 222 __u8 shadowMCR; /* last MCR value received */
224 char open; 223 char open;
@@ -478,7 +477,6 @@ static void mos7840_control_callback(struct urb *urb)
478 struct moschip_port *mos7840_port; 477 struct moschip_port *mos7840_port;
479 struct device *dev = &urb->dev->dev; 478 struct device *dev = &urb->dev->dev;
480 __u8 regval = 0x0; 479 __u8 regval = 0x0;
481 int result = 0;
482 int status = urb->status; 480 int status = urb->status;
483 481
484 mos7840_port = urb->context; 482 mos7840_port = urb->context;
@@ -495,7 +493,7 @@ static void mos7840_control_callback(struct urb *urb)
495 return; 493 return;
496 default: 494 default:
497 dev_dbg(dev, "%s - nonzero urb status received: %d\n", __func__, status); 495 dev_dbg(dev, "%s - nonzero urb status received: %d\n", __func__, status);
498 goto exit; 496 return;
499 } 497 }
500 498
501 dev_dbg(dev, "%s urb buffer size is %d\n", __func__, urb->actual_length); 499 dev_dbg(dev, "%s urb buffer size is %d\n", __func__, urb->actual_length);
@@ -508,16 +506,6 @@ static void mos7840_control_callback(struct urb *urb)
508 mos7840_handle_new_msr(mos7840_port, regval); 506 mos7840_handle_new_msr(mos7840_port, regval);
509 else if (mos7840_port->MsrLsr == 1) 507 else if (mos7840_port->MsrLsr == 1)
510 mos7840_handle_new_lsr(mos7840_port, regval); 508 mos7840_handle_new_lsr(mos7840_port, regval);
511
512exit:
513 spin_lock(&mos7840_port->pool_lock);
514 if (!mos7840_port->zombie)
515 result = usb_submit_urb(mos7840_port->int_urb, GFP_ATOMIC);
516 spin_unlock(&mos7840_port->pool_lock);
517 if (result) {
518 dev_err(dev, "%s - Error %d submitting interrupt urb\n",
519 __func__, result);
520 }
521} 509}
522 510
523static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg, 511static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg,