Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] af9035: unlock on error in af9035_i2c_master_xfer()

We introduced a couple new error paths which are missing unlocks.
Fixes: 7760e148350b ('[media] af9035: Don't use dynamic static allocation')

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: stable@vger.kernel.org

authored by

Dan Carpenter and committed by
Mauro Carvalho Chehab
3189ef02 d18a88b1

+5 -2
+5 -2
drivers/media/usb/dvb-usb-v2/af9035.c
··· 245 245 dev_warn(&d->udev->dev, 246 246 "%s: i2c xfer: len=%d is too big!\n", 247 247 KBUILD_MODNAME, msg[0].len); 248 - return -EOPNOTSUPP; 248 + ret = -EOPNOTSUPP; 249 + goto unlock; 249 250 } 250 251 req.mbox |= ((msg[0].addr & 0x80) >> 3); 251 252 buf[0] = msg[1].len; ··· 282 281 dev_warn(&d->udev->dev, 283 282 "%s: i2c xfer: len=%d is too big!\n", 284 283 KBUILD_MODNAME, msg[0].len); 285 - return -EOPNOTSUPP; 284 + ret = -EOPNOTSUPP; 285 + goto unlock; 286 286 } 287 287 req.mbox |= ((msg[0].addr & 0x80) >> 3); 288 288 buf[0] = msg[0].len; ··· 321 319 ret = -EOPNOTSUPP; 322 320 } 323 321 322 + unlock: 324 323 mutex_unlock(&d->i2c_mutex); 325 324 326 325 if (ret < 0)