Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1496460

[PATCH 4.4 55/93] [media] em28xx-i2c: rt_mutex_trylock() returns zero on failure

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.4 55/93] [media] em28xx-i2c: rt_mutex_trylock() returns zero on failure
Date 2016-10-06 11:20 +0200
Message-ID <spd0m-6Av-41@gated-at.bofh.it> (permalink)
References <spcGZ-6dt-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Carpenter <dan.carpenter@oracle.com>

commit e44c153b30c9a0580fc2b5a93f3c6d593def2278 upstream.

The code is checking for negative returns but it should be checking for
zero.

Fixes: aab3125c43d8 ('[media] em28xx: add support for registering multiple i2c buses')

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/media/usb/em28xx/em28xx-i2c.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/media/usb/em28xx/em28xx-i2c.c
+++ b/drivers/media/usb/em28xx/em28xx-i2c.c
@@ -507,9 +507,8 @@ static int em28xx_i2c_xfer(struct i2c_ad
 	if (dev->disconnected)
 		return -ENODEV;
 
-	rc = rt_mutex_trylock(&dev->i2c_bus_lock);
-	if (rc < 0)
-		return rc;
+	if (!rt_mutex_trylock(&dev->i2c_bus_lock))
+		return -EAGAIN;
 
 	/* Switch I2C bus if needed */
 	if (bus != dev->cur_i2c_bus &&

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.4 00/93] 4.4.24-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:00 +0200
  [PATCH 4.4 68/93] brcmsmac: Initialize power in brcms_c_stf_ss_algo_channel_get() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:00 +0200
  [PATCH 4.4 02/93] mtd: nand: davinci: Reinitialize the HW ECC engine in 4bit hwctl Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:00 +0200
  [PATCH 4.4 63/93] pNFS/files: Fix layoutcommit after a commit to DS Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:00 +0200
  [PATCH 4.4 16/93] pinctrl: uniphier: fix .pin_dbg_show() callback Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:00 +0200
  [PATCH 4.4 92/93] ALSA: hda - Fix headset mic detection problem for several Dell laptops Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 75/93] IB/ipoib: Fix memory corruption in ipoib cm mode connect flow Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 72/93] kernel/fork: fix CLONE_CHILD_CLEARTID regression in nscd Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 46/93] ARM: sa1100: clear reset status prior to reboot Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 84/93] dm log writes: fix bug with too large bios Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 88/93] USB: serial: cp210x: Add ID for a Juniper console Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 77/93] IB/ipoib: Dont allow MC joins during light MC flush Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 83/93] clk: xgene: Add missing parenthesis when clearing divider value Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 82/93] aio: mark AIO pseudo-fs noexec Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 37/93] printk: fix parsing of "brl=" option Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 89/93] Revert "usbtmc: convert to devm_kzalloc" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 41/93] regulator: qcom_spmi: Update mvs1/mvs2 switches on pm8941 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 78/93] IB/mlx4: Fix incorrect MC join state bit-masking on SR-IOV Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 45/93] ARM: sa1100: fix 3.6864MHz clock Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 93/93] ALSA: hda - Add the top speaker pin config for HP Spectre x360 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 85/93] USB: serial: cp210x: fix hardware flow-control disable Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 42/93] regulator: qcom_smd: Fix voltage ranges for pm8x41 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 76/93] IB/core: Fix use after free in send_leave function Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 90/93] ALSA: hda - Adding one more ALC255 pin definition for headset problem Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 44/93] ARM: sa1100: register clocks early Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 79/93] IB/mlx4: Fix code indentation in QP1 MAD flow Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 87/93] Staging: fbtft: Fix bug in fbtft-core Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 91/93] ACPICA: acpi_get_sleep_type_data: Reduce warnings Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 80/93] IB/mlx4: Use correct subnet-prefix in QP1 mads under SR-IOV Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 65/93] ASoC: Intel: Skylake: Fix error return code in skl_probe() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 86/93] usb: misc: legousbtower: Fix NULL pointer deference Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:10 +0200
  [PATCH 4.4 55/93] [media] em28xx-i2c: rt_mutex_trylock() returns zero on failure Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:20 +0200
  [PATCH 4.4 56/93] [media] gspca: avoid unused variable warnings Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:20 +0200
  [PATCH 4.4 01/93] cpuset: handle race between CPU hotplug and cpuset_hotplug_work Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:30 +0200
  [PATCH 4.4 21/93] ipvs: fix bind to link-local mcast IPv6 address in backup Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 11:30 +0200
  [PATCH 4.4 27/93] ceph: fix race during filling readdir cache Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-06 12:40 +0200
  Re: [PATCH 4.4 00/93] 4.4.24-stable review Guenter Roeck <linux@roeck-us.net> - 2016-10-06 20:50 +0200
  Re: [PATCH 4.4 00/93] 4.4.24-stable review Shuah Khan <shuah.kh@samsung.com> - 2016-10-06 22:00 +0200
  Re: [PATCH 4.4 00/93] 4.4.24-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-07 15:10 +0200
    Re: [PATCH 4.4 00/93] 4.4.24-stable review Kevin Hilman <khilman@baylibre.com> - 2016-10-08 12:00 +0200

csiph-web