aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/dvb-usb-v2/af9035.c
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-03-26 00:32:19 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-26 07:37:45 -0400
commit0170a39b69ae65fffb40bd162730e3de2b87c835 (patch)
tree3d2ce260a461cac9d841b9d320d94ac5fb51afcc /drivers/media/usb/dvb-usb-v2/af9035.c
parent004e45d736bfe62159bd4dc1549eff414bd27496 (diff)
[media] af9035: fix missing unlock on error in af9035_ctrl_msg()
Add the missing unlock before return from function af9035_ctrl_msg() in the error handling case. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Antti Palosaari <crope@iki.fi> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/dvb-usb-v2/af9035.c')
-rw-r--r--drivers/media/usb/dvb-usb-v2/af9035.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
index b1f7059bf4a5..b638fc1cd574 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -57,7 +57,7 @@ static int af9035_ctrl_msg(struct dvb_usb_device *d, struct usb_req *req)
57 dev_err(&d->udev->dev, "%s: too much data wlen=%d rlen=%d\n", 57 dev_err(&d->udev->dev, "%s: too much data wlen=%d rlen=%d\n",
58 __func__, req->wlen, req->rlen); 58 __func__, req->wlen, req->rlen);
59 ret = -EINVAL; 59 ret = -EINVAL;
60 goto err; 60 goto exit;
61 } 61 }
62 62
63 state->buf[0] = REQ_HDR_LEN + req->wlen + CHECKSUM_LEN - 1; 63 state->buf[0] = REQ_HDR_LEN + req->wlen + CHECKSUM_LEN - 1;
@@ -81,7 +81,7 @@ static int af9035_ctrl_msg(struct dvb_usb_device *d, struct usb_req *req)
81 ret = dvb_usbv2_generic_rw_locked(d, 81 ret = dvb_usbv2_generic_rw_locked(d,
82 state->buf, wlen, state->buf, rlen); 82 state->buf, wlen, state->buf, rlen);
83 if (ret) 83 if (ret)
84 goto err; 84 goto exit;
85 85
86 /* no ack for those packets */ 86 /* no ack for those packets */
87 if (req->cmd == CMD_FW_DL) 87 if (req->cmd == CMD_FW_DL)
@@ -95,28 +95,29 @@ static int af9035_ctrl_msg(struct dvb_usb_device *d, struct usb_req *req)
95 "(%04x != %04x)\n", KBUILD_MODNAME, req->cmd, 95 "(%04x != %04x)\n", KBUILD_MODNAME, req->cmd,
96 tmp_checksum, checksum); 96 tmp_checksum, checksum);
97 ret = -EIO; 97 ret = -EIO;
98 goto err; 98 goto exit;
99 } 99 }
100 100
101 /* check status */ 101 /* check status */
102 if (state->buf[2]) { 102 if (state->buf[2]) {
103 /* fw returns status 1 when IR code was not received */ 103 /* fw returns status 1 when IR code was not received */
104 if (req->cmd == CMD_IR_GET || state->buf[2] == 1) 104 if (req->cmd == CMD_IR_GET || state->buf[2] == 1) {
105 return 1; 105 ret = 1;
106 goto exit;
107 }
106 108
107 dev_dbg(&d->udev->dev, "%s: command=%02x failed fw error=%d\n", 109 dev_dbg(&d->udev->dev, "%s: command=%02x failed fw error=%d\n",
108 __func__, req->cmd, state->buf[2]); 110 __func__, req->cmd, state->buf[2]);
109 ret = -EIO; 111 ret = -EIO;
110 goto err; 112 goto exit;
111 } 113 }
112 114
113 /* read request, copy returned data to return buf */ 115 /* read request, copy returned data to return buf */
114 if (req->rlen) 116 if (req->rlen)
115 memcpy(req->rbuf, &state->buf[ACK_HDR_LEN], req->rlen); 117 memcpy(req->rbuf, &state->buf[ACK_HDR_LEN], req->rlen);
116exit: 118exit:
117err:
118 mutex_unlock(&d->usb_mutex); 119 mutex_unlock(&d->usb_mutex);
119 if (ret) 120 if (ret < 0)
120 dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret); 121 dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
121 return ret; 122 return ret;
122} 123}