All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>,
	Stable@vger.kernel.org,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: [PATCH 4.4 33/37] iio: ltr501: Dont return error code in trigger handler
Date: Mon, 13 Dec 2021 10:30:11 +0100	[thread overview]
Message-ID: <20211213092926.469234767@linuxfoundation.org> (raw)
In-Reply-To: <20211213092925.380184671@linuxfoundation.org>

From: Lars-Peter Clausen <lars@metafoo.de>

commit ef9d67fa72c1b149a420587e435a3e888bdbf74f upstream.

IIO trigger handlers need to return one of the irqreturn_t values.
Returning an error code is not supported.

The ltr501 interrupt handler gets this right for most error paths, but
there is one case where it returns the error code.

In addition for this particular case the trigger handler does not call
`iio_trigger_notify_done()`. Which when not done keeps the triggered
disabled forever.

Modify the code so that the function returns a valid irqreturn_t value as
well as calling `iio_trigger_notify_done()` on all exit paths.

Fixes: 2690be905123 ("iio: Add Lite-On ltr501 ambient light / proximity sensor driver")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20211024171251.22896-1-lars@metafoo.de
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/iio/light/ltr501.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/iio/light/ltr501.c
+++ b/drivers/iio/light/ltr501.c
@@ -1248,7 +1248,7 @@ static irqreturn_t ltr501_trigger_handle
 		ret = regmap_bulk_read(data->regmap, LTR501_ALS_DATA1,
 				       (u8 *)als_buf, sizeof(als_buf));
 		if (ret < 0)
-			return ret;
+			goto done;
 		if (test_bit(0, indio_dev->active_scan_mask))
 			scan.channels[j++] = le16_to_cpu(als_buf[1]);
 		if (test_bit(1, indio_dev->active_scan_mask))



  parent reply	other threads:[~2021-12-13  9:34 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-13  9:29 [PATCH 4.4 00/37] 4.4.295-rc1 review Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 01/37] HID: introduce hid_is_using_ll_driver Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 02/37] HID: add hid_is_usb() function to make it simpler for USB detection Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 03/37] HID: add USB_HID dependancy to hid-prodikeys Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 04/37] HID: add USB_HID dependancy to hid-chicony Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 05/37] HID: add USB_HID dependancy on some USB HID drivers Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 06/37] HID: wacom: fix problems when device is not a valid USB device Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 07/37] HID: check for valid USB device for many HID drivers Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 08/37] can: sja1000: fix use after free in ems_pcmcia_add_card() Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 09/37] nfc: fix potential NULL pointer deref in nfc_genl_dump_ses_done Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 10/37] mm: bdi: initialize bdi_min_ratio when bdi is unregistered Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 11/37] ALSA: ctl: Fix copy of updated id with element read/write Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 12/37] ALSA: pcm: oss: Fix negative period/buffer sizes Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 13/37] ALSA: pcm: oss: Limit the period size to 16MB Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 14/37] ALSA: pcm: oss: Handle missing errors in snd_pcm_oss_change_params*() Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 15/37] tracefs: Have new files inherit the ownership of their parent Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 16/37] can: pch_can: pch_can_rx_normal: fix use after free Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 17/37] libata: add horkage for ASMedia 1092 Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 18/37] wait: add wake_up_pollfree() Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 19/37] binder: use wake_up_pollfree() Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 20/37] signalfd: " Greg Kroah-Hartman
2021-12-13  9:29 ` [PATCH 4.4 21/37] tracefs: Set all files to the same group ownership as the mount option Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 22/37] block: fix ioprio_get(IOPRIO_WHO_PGRP) vs setuid(2) Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 23/37] net: cdc_ncm: Allow for dwNtbOutMaxSize to be unset or zero Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 24/37] net: altera: set a couple error code in probe() Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 25/37] net: fec: only clear interrupt of handling queue in fec_enet_rx_queue() Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 26/37] net, neigh: clear whole pneigh_entry at alloc time Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 27/37] net/qla3xxx: fix an error code in ql_adapter_up() Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 28/37] USB: gadget: detect too-big endpoint 0 requests Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 29/37] USB: gadget: zero allocate endpoint 0 buffers Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 30/37] usb: core: config: fix validation of wMaxPacketValue entries Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 31/37] iio: stk3310: Dont return error code in interrupt handler Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 32/37] iio: mma8452: Fix trigger reference couting Greg Kroah-Hartman
2021-12-13  9:30 ` Greg Kroah-Hartman [this message]
2021-12-13  9:30 ` [PATCH 4.4 34/37] iio: itg3200: Call iio_trigger_notify_done() on error Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 35/37] iio: accel: kxcjk-1013: Fix possible memory leak in probe and remove Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 36/37] irqchip/irq-gic-v3-its.c: Force synchronisation when issuing INVALL Greg Kroah-Hartman
2021-12-13  9:30 ` [PATCH 4.4 37/37] irqchip: nvic: Fix offset for Interrupt Priority Offsets Greg Kroah-Hartman
2021-12-13 10:31 ` [PATCH 4.4 00/37] 4.4.295-rc1 review Pavel Machek
2021-12-13 14:42 ` Jon Hunter
2021-12-13 19:54 ` Guenter Roeck
2021-12-13 20:31 ` Shuah Khan
2021-12-14  8:01 ` Naresh Kamboju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211213092926.469234767@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.