Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp802272imu; Tue, 11 Dec 2018 07:49:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/W/WsszAqVqiLA88nUW5/1rOWbcVY1yFkqshuvVSB2u+WGuDkM6FxHbZrscGaJf3bZK5nQr X-Received: by 2002:a17:902:1127:: with SMTP id d36mr3474170pla.299.1544543370401; Tue, 11 Dec 2018 07:49:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544543370; cv=none; d=google.com; s=arc-20160816; b=pcfLvigy+e9bdA10QYx8RjzXkD8zDBtQsTtlJOHrx5A7cVdcTc0rz8XCnMUyGl1bXU U6qKztNO1fcpO1PFkoIY6rFLZGF0hBk+G7+JDiZ35u7v5WJJX/JtA2SniAr3E8rwPsJC ov/myQ7yWQhIch7uucx7E4HRdwLY4gxvbvrgcV1LzQCGPuLxnmwNOVTOc3JDY1jsZ0fR cwllgsx+Oud+kbHwLcl8RM7kFZny5calpIb7rN/u0easJKoS1bZekTpCHt05Fo4zpZGf JHreCOu3npP9jEW/kMvIcHGSr2zmNWrREI28K5v4zA6LMRc15Vm2DdBjYje8CfbLmwAM e7sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gM1BIOwIWWXaZxGJTPXOoBEeLkmJGBrmtEZiyT1lOV4=; b=XHKa3GQ2wQml+aTne8MDBL7w32C3Z3axd9diZM59OWP+g8HZ7kJJ1mP6QS9+X7sGj2 zxZPmzQ9U+qZwCHTGhnGPZ+5i9CAUxqPowOBXMoJKPreax9f9Hd1g0NqelyQMVsM0RjT Mw5Ph7rYDtOgdB6GYXuzwmD35obTOcjPK0A8RNTZsqmBYWDGqNCSuwaRURiohAMBJPpm eauDP/5Ha5CdbsD/9/ORDUbRjzZ0HEmBbctRUOI5NFhKWjPjM+150zV670VCPmwm/fqF jyWEM1eRxE6GG+iolmnIRs/AFNCRxwnPFiqgKdL+a6DUktNWNpNEJEr6u5RlR/zecsSO k0Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WvNhYkX8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w19si12437838pgf.573.2018.12.11.07.49.15; Tue, 11 Dec 2018 07:49:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WvNhYkX8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728343AbeLKPq2 (ORCPT + 99 others); Tue, 11 Dec 2018 10:46:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:34844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727567AbeLKPq0 (ORCPT ); Tue, 11 Dec 2018 10:46:26 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C5B32208E7; Tue, 11 Dec 2018 15:46:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543186; bh=4CSWEAdwlDSXtIyWdtY+XhwrZcKqNlBD4l8pUUH/0s0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WvNhYkX80jfYP90HYDN/IZ5MFftY43le0+grB/efZ46qYiW4RddmVisH2DMIE5mlF ue5i/9AcGQlNjDaGMhbHsmu2pbZjqxjujDlStsSjyC2lVxxZiF5Kj40dISh2kdp3WG 7s2cpot4D1YVl8SBLRXHL1IY2csVldLaic6MqWe0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wei Yongjun , Jacek Anaszewski , Krzysztof Kozlowski Subject: [PATCH 4.4 44/91] leds: leds-gpio: Fix return value check in create_gpio_led() Date: Tue, 11 Dec 2018 16:41:03 +0100 Message-Id: <20181211151609.585460748@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151606.026852373@linuxfoundation.org> References: <20181211151606.026852373@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wei Yongjun commit 2d88a331e48095cf60ad9bdf3177bd401bf99727 upstream. In case of error, the function gpio_to_desc() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun Signed-off-by: Jacek Anaszewski Signed-off-by: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman --- drivers/leds/leds-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -118,8 +118,8 @@ static int create_gpio_led(const struct return ret; led_dat->gpiod = gpio_to_desc(template->gpio); - if (IS_ERR(led_dat->gpiod)) - return PTR_ERR(led_dat->gpiod); + if (!led_dat->gpiod) + return -EINVAL; } led_dat->cdev.name = template->name;