Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754621AbbBSOG3 (ORCPT ); Thu, 19 Feb 2015 09:06:29 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:39157 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753445AbbBSNwL (ORCPT ); Thu, 19 Feb 2015 08:52:11 -0500 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Johan Hovold , Linus Walleij , Luis Henriques Subject: [PATCH 3.16.y-ckt 13/58] gpio: sysfs: fix memory leak in gpiod_sysfs_set_active_low Date: Thu, 19 Feb 2015 13:51:43 +0000 Message-Id: <1424353948-31863-14-git-send-email-luis.henriques@canonical.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1424353948-31863-1-git-send-email-luis.henriques@canonical.com> References: <1424353948-31863-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1389 Lines: 43 3.16.7-ckt7 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit 49d2ca84e433dab854c7a866bc6add09cfab682d upstream. Fix memory leak in the gpio sysfs interface due to failure to drop reference to device returned by class_find_device when setting the gpio-line polarity. Fixes: 0769746183ca ("gpiolib: add support for changing value polarity in sysfs") Signed-off-by: Johan Hovold Signed-off-by: Linus Walleij [ luis: backported to 3.16: - file rename: drivers/gpio/gpiolib-sysfs.c -> drivers/gpio/gpiolib.c ] Signed-off-by: Luis Henriques --- drivers/gpio/gpiolib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 69fc2fcfc3e9..afdca5a6b2a6 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -960,6 +960,7 @@ int gpiod_sysfs_set_active_low(struct gpio_desc *desc, int value) status = sysfs_set_active_low(desc, dev, value); + put_device(dev); unlock: mutex_unlock(&sysfs_lock); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/