Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3189ef02 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mauro Carvalho Chehab
Browse files

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



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

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
Cc: stable@vger.kernel.org
parent d18a88b1
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -245,7 +245,8 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
				dev_warn(&d->udev->dev,
				dev_warn(&d->udev->dev,
					 "%s: i2c xfer: len=%d is too big!\n",
					 "%s: i2c xfer: len=%d is too big!\n",
					 KBUILD_MODNAME, msg[0].len);
					 KBUILD_MODNAME, msg[0].len);
				return -EOPNOTSUPP;
				ret = -EOPNOTSUPP;
				goto unlock;
			}
			}
			req.mbox |= ((msg[0].addr & 0x80)  >>  3);
			req.mbox |= ((msg[0].addr & 0x80)  >>  3);
			buf[0] = msg[1].len;
			buf[0] = msg[1].len;
@@ -281,7 +282,8 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
				dev_warn(&d->udev->dev,
				dev_warn(&d->udev->dev,
					 "%s: i2c xfer: len=%d is too big!\n",
					 "%s: i2c xfer: len=%d is too big!\n",
					 KBUILD_MODNAME, msg[0].len);
					 KBUILD_MODNAME, msg[0].len);
				return -EOPNOTSUPP;
				ret = -EOPNOTSUPP;
				goto unlock;
			}
			}
			req.mbox |= ((msg[0].addr & 0x80)  >>  3);
			req.mbox |= ((msg[0].addr & 0x80)  >>  3);
			buf[0] = msg[0].len;
			buf[0] = msg[0].len;
@@ -319,6 +321,7 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
		ret = -EOPNOTSUPP;
		ret = -EOPNOTSUPP;
	}
	}


unlock:
	mutex_unlock(&d->i2c_mutex);
	mutex_unlock(&d->i2c_mutex);


	if (ret < 0)
	if (ret < 0)