From patchwork Wed Mar 9 23:08:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 595304 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 4E1D614030F; Thu, 10 Mar 2016 10:09:45 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1adnEc-0000Mv-Do; Wed, 09 Mar 2016 23:09:42 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1adnDs-0008Oo-PH for kernel-team@lists.ubuntu.com; Wed, 09 Mar 2016 23:08:56 +0000 Received: from 1.general.kamal.us.vpn ([10.172.68.52] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1adnDs-0001qh-8y; Wed, 09 Mar 2016 23:08:56 +0000 Received: from kamal by fourier with local (Exim 4.86) (envelope-from ) id 1adnDo-0002LK-Ke; Wed, 09 Mar 2016 15:08:52 -0800 From: Kamal Mostafa To: Dan Carpenter Subject: [3.13.y-ckt stable] Patch "iio: inkern: fix a NULL dereference on error" has been added to the 3.13.y-ckt tree Date: Wed, 9 Mar 2016 15:08:51 -0800 Message-Id: <1457564931-8963-1-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 2.7.0 X-Extended-Stable: 3.13 Cc: Kamal Mostafa , kernel-team@lists.ubuntu.com, Jonathan Cameron X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled iio: inkern: fix a NULL dereference on error to the linux-3.13.y-queue branch of the 3.13.y-ckt extended stable tree which can be found at: http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.13.y-queue This patch is scheduled to be released in version 3.13.11-ckt36. If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.13.y-ckt tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Kamal ---8<------------------------------------------------------------ From 12b7eb05484917a95fa68b056aa39124f22f8c16 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 26 Jan 2016 12:25:21 +0300 Subject: iio: inkern: fix a NULL dereference on error commit d81dac3c1c5295c61b15293074ac2bd3254e1875 upstream. In twl4030_bci_probe() there are some failure paths where we call iio_channel_release() with a NULL pointer. (Apparently, that driver can opperate without a valid channel pointer). Let's fix it by adding a NULL check in iio_channel_release(). Fixes: 2202e1fc5a29 ('drivers: power: twl4030_charger: fix link problems when building as module') Signed-off-by: Dan Carpenter Signed-off-by: Jonathan Cameron Signed-off-by: Kamal Mostafa --- drivers/iio/inkern.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.0 diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 4fc88e6..e08b28f 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -325,6 +325,8 @@ EXPORT_SYMBOL_GPL(iio_channel_get); void iio_channel_release(struct iio_channel *channel) { + if (!channel) + return; iio_device_put(channel->indio_dev); kfree(channel); }