mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kamal Mostafa <kamal@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	kernel-team@lists.ubuntu.com
Cc: Darshana Padmadas <darshanapadmadas@gmail.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Kamal Mostafa <kamal@canonical.com>
Subject: [PATCH 3.13.y-ckt 51/90] iio: imu: Use iio_trigger_get for indio_dev->trig assignment
Date: Tue,  5 May 2015 13:54:23 -0700	[thread overview]
Message-ID: <1430859302-5886-52-git-send-email-kamal@canonical.com> (raw)
In-Reply-To: <1430859302-5886-1-git-send-email-kamal@canonical.com>

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

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

From: Darshana Padmadas <darshanapadmadas@gmail.com>

commit 4ce7ca89d6e8eae9e201cd0e972ba323f33e2fb4 upstream.

This patch uses iio_trigger_get to increment the reference
count of trigger device, to avoid incorrect assignment.
Can result in a null pointer dereference during removal if the
trigger has been changed before removal.

This patch refers to a similar situation encountered through the
following discussion:
http://www.spinics.net/lists/linux-iio/msg13669.html

Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iio/imu/adis_trigger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/imu/adis_trigger.c b/drivers/iio/imu/adis_trigger.c
index e0017c2..f53e9a8 100644
--- a/drivers/iio/imu/adis_trigger.c
+++ b/drivers/iio/imu/adis_trigger.c
@@ -60,7 +60,7 @@ int adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev)
 	iio_trigger_set_drvdata(adis->trig, adis);
 	ret = iio_trigger_register(adis->trig);
 
-	indio_dev->trig = adis->trig;
+	indio_dev->trig = iio_trigger_get(adis->trig);
 	if (ret)
 		goto error_free_irq;
 
-- 
1.9.1


  parent reply	other threads:[~2015-05-05 21:11 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05 20:53 [3.13.y-ckt stable] Linux 3.13.11-ckt20 stable review Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 01/90] Input: serio - add firmware_id sysfs attribute Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 02/90] Input: i8042 - add firmware_id support Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 03/90] Input: Add INPUT_PROP_TOPBUTTONPAD device property Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 04/90] Input: synaptics - report INPUT_PROP_TOPBUTTONPAD property Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 05/90] Input: synaptics - add a matches_pnp_id helper function Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 06/90] Input: synaptics - change min/max quirk table to pnp-id matching Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 07/90] Input: psmouse - add psmouse_matches_pnp_id helper function Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 08/90] Input: synaptics - split synaptics_resolution(), query first Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 09/90] Input: synaptics - log queried and quirked dimension values Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 10/90] Input: synaptics - remove obsolete min/max quirk for X240 Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 11/90] Input: synaptics - add min/max quirk for pnp-id LEN2002 (Edge E531) Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 12/90] Input: synaptics - add min/max quirk for Lenovo T440s Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 13/90] Input: synaptics - adjust min/max for Lenovo ThinkPad X1 Carbon 2nd Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 14/90] Input: synaptics - adjust min/max on Thinkpad E540 Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 15/90] Input: synaptics - support min/max board id in min_max_pnpid_table Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 16/90] Input: synaptics - skip quirks when post-2013 dimensions Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 17/90] n_tty: Merge .receive_buf() flavors Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 18/90] n_tty: Fix read buffer overwrite when no newline Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 19/90] KVM: x86: Fix lost interrupt on irr_pending race Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 20/90] fs: take i_mutex during prepare_binprm for set[ug]id executables Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 21/90] tcp: Fix crash in TCP Fast Open Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 22/90] writeback: add missing INITIAL_JIFFIES init in global_update_bandwidth() Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 23/90] nbd: fix possible memory leak Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 24/90] mfd: kempld-core: Fix callback return value check Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 25/90] KVM: nVMX: mask unrestricted_guest if disabled on L0 Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 26/90] spi: trigger trace event for message-done before mesg->complete Kamal Mostafa
2015-05-05 20:53 ` [PATCH 3.13.y-ckt 27/90] powerpc/pseries: Little endian fixes for post mobility device tree update Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 28/90] net: ethernet: pcnet32: Setup the SRAM and NOUFLO on Am79C97{3, 5} Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 29/90] perf: Fix irq_work 'tail' recursion Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 30/90] arm64: Use the reserved TTBR0 if context switching to the init_mm Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 31/90] selinux: fix sel_write_enforce broken return value Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 32/90] mm: fix anon_vma->degree underflow in anon_vma endless growing prevention Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 33/90] mm/memory hotplug: postpone the reset of obsolete pgdat Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 34/90] hfsplus: fix B-tree corruption after insertion at position 0 Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 35/90] ARC: SA_SIGINFO ucontext regs off-by-one Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 36/90] writeback: fix possible underflow in write bandwidth calculation Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 37/90] iio: fix drivers that check buffer->scan_mask Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 38/90] iio: inv_mpu6050: Clear timestamps fifo while resetting hardware fifo Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 39/90] iio: core: Fix double free Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 40/90] USB: ftdi_sio: Added custom PID for Synapse Wireless product Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 41/90] iwlwifi: dvm: run INIT firmware again upon .start() Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 42/90] USB: keyspan_pda: add new device id Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 43/90] cifs: smb2_clone_range() - exit on unhandled error Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 44/90] cifs: fix use-after-free bug in find_writable_file Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 45/90] can: flexcan: Deferred on Regulator return EPROBE_DEFER Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 46/90] usb: xhci: handle Config Error Change (CEC) in xhci driver Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 47/90] usb: xhci: apply XHCI_AVOID_BEI quirk to all Intel xHCI controllers Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 48/90] USB: ftdi_sio: Use jtag quirk for SNAP Connect E10 Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 49/90] tty: serial: fsl_lpuart: clear receive flag on FIFO flush Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 50/90] radeon: Do not directly dereference pointers to BIOS area Kamal Mostafa
2015-05-05 20:54 ` Kamal Mostafa [this message]
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 52/90] dmaengine: edma: fix memory leak when terminating running transfers Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 53/90] dmaengine: omap-dma: Fix memory leak when terminating running transfer Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 54/90] x86/reboot: Add ASRock Q1900DC-ITX mainboard reboot quirk Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 55/90] mac80211: fix RX A-MPDU session reorder timer deletion Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 56/90] IB/uverbs: Prevent integer overflow in ib_umem_get address arithmetic Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 57/90] tcp: prevent fetching dst twice in early demux code Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 58/90] net: use for_each_netdev_safe() in rtnl_group_changelink() Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 59/90] xen-netfront: transmit fully GSO-sized packets Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 60/90] tcp: fix FRTO undo on cumulative ACK of SACKed range Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 61/90] PCI: cpcihp: Add missing curly braces in cpci_configure_slot() Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 62/90] [media] sh_veu: v4l2_dev wasn't set Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 63/90] [media] media: s5p-mfc: fix mmap support for 64bit arch Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 64/90] cpuidle: ACPI: do not overwrite name and description of C0 Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 65/90] ioctx_alloc(): fix vma (and file) leak on failure Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 66/90] ALSA: hda/realtek - Make more stable to get pin sense for ALC283 Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 67/90] be2iscsi: Fix kernel panic when device initialization fails Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 68/90] Defer processing of REQ_PREEMPT requests for blocked devices Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 69/90] ALSA: hda - Fix headphone pin config for Lifebook T731 Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 70/90] ocfs2: _really_ sync the right range Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 71/90] ALSA: usb - Creative USB X-Fi Pro SB1095 volume knob support Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 72/90] iscsi target: fix oops when adding reject pdu Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 73/90] net/mlx4_en: Call register_netdevice in the proper location Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 74/90] ipv6: protect skb->sk accesses from recursive dereference inside the stack Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 75/90] tcp: tcp_make_synack() should clear skb->tstamp Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 76/90] 8139cp: Call dev_kfree_skby_any instead of kfree_skb Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 77/90] 8139too: Call dev_kfree_skby_any instead of dev_kfree_skb Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 78/90] r8169: " Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 79/90] bonding: Call dev_kfree_skby_any instead of kfree_skb Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 80/90] bnx2: Call dev_kfree_skby_any instead of dev_kfree_skb Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 81/90] tg3: " Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 82/90] ixgb: " Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 83/90] benet: Call dev_kfree_skby_any instead of kfree_skb Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 84/90] gianfar: Carefully free skbs in functions called by netpoll Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 85/90] ip_forward: Drop frames with attached skb->sk Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 86/90] tcp: fix possible deadlock in tcp_send_fin() Kamal Mostafa
2015-05-05 20:54 ` [PATCH 3.13.y-ckt 87/90] tcp: avoid looping " Kamal Mostafa
2015-05-05 20:55 ` [PATCH 3.13.y-ckt 88/90] net: do not deplete pfmemalloc reserve Kamal Mostafa
2015-05-05 20:55 ` [PATCH 3.13.y-ckt 89/90] net: fix crash in build_skb() Kamal Mostafa
2015-05-05 20:55 ` [PATCH 3.13.y-ckt 90/90] ipv4: Missing sk_nulls_node_init() in ping_unhash() Kamal Mostafa

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=1430859302-5886-52-git-send-email-kamal@canonical.com \
    --to=kamal@canonical.com \
    --cc=darshanapadmadas@gmail.com \
    --cc=jic23@kernel.org \
    --cc=kernel-team@lists.ubuntu.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®