From patchwork Wed Jan 25 14:03:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9537141 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E55F8601D7 for ; Wed, 25 Jan 2017 14:03:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D64D128306 for ; Wed, 25 Jan 2017 14:03:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C91BF2832B; Wed, 25 Jan 2017 14:03:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53B7B28306 for ; Wed, 25 Jan 2017 14:03:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751720AbdAYOD3 (ORCPT ); Wed, 25 Jan 2017 09:03:29 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36499 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751576AbdAYOD2 (ORCPT ); Wed, 25 Jan 2017 09:03:28 -0500 Received: by mail-pf0-f195.google.com with SMTP id 19so14443024pfo.3; Wed, 25 Jan 2017 06:03:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uXUlXoYOn316lQ19nxaLfDUCGfr903FHDSJdKbqllqU=; b=UOmhp81r26Ekb6coRVphEFBwQNh9zWDrAnolCA1v+9QZ2VdlHn2Slrfpy2hDQmPVgA SfFvVJgwo0AZ7LSSnXXsVApS7Q+dX7xoecSw0DyrSbAwmCZ3Auu/8W7K67yRb3n7xdmG M2OMTV3I+B22P5V7d6/V1KkN+WpBGY31v+mL2Z7roZd76I68u7UsGK1qwxoKDilE0N6o ByP3/6uFKcEWhOxX99FtKKrHPO9EryhvaMm6tvQBi4iOJ196ki3vhotquIN1HHzGqOk4 piOl8YB8rEsv3PGP4//vOyF/1babJGPBI/wkIwHM1ZIzmXmOE4S1kCc6wbeBUb4piKRt SyEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uXUlXoYOn316lQ19nxaLfDUCGfr903FHDSJdKbqllqU=; b=CCCwvjqAic81BOuphnQkh6MwiXHxmYzZq+v9rG9v49rtjrPgsVed29/JwddiLFK16o dkTLYYEQ6BO2tWJHtcm3X8hvx+czZDRouxbanjaE3Ra3/qVhLvz4xkSaCE5r/CL9/rxF S1VCXZaT/KrQhMaxVrJz8gmnjgf0f2BW0IaB4NG7HkEoPa+PWD+hUGHFXubOISj8B+Nn tkRaT3ZTZfXutCNRK3+rl5TDAvoors9j+X7ECHkhDwFZ3LKsd0gH0yH3ezFSEWMQtbQw AaG8enpZadf8hUQfwwqNj9qSlHeRxD4gsSF+FT2sEcnkVQBRwE3HN6atW+uKwymfCtYb yWWw== X-Gm-Message-State: AIkVDXJL5y08v8RSxLd+NP5dhmHaxh+70LyZ5dPe/QJdJNb9BL5L8VTr9mfHi2brarRMDQ== X-Received: by 10.98.7.150 with SMTP id 22mr47064248pfh.69.1485353007758; Wed, 25 Jan 2017 06:03:27 -0800 (PST) Received: from localhost.localdomain.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id z77sm1637013pfk.47.2017.01.25.06.03.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jan 2017 06:03:27 -0800 (PST) From: Wei Yongjun To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi , Linus Walleij Cc: Wei Yongjun , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH -next] pinctrl: samsung: Fix return value check in samsung_pinctrl_get_soc_data() Date: Wed, 25 Jan 2017 14:03:21 +0000 Message-Id: <20170125140321.23911-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 8b1bd11c1f8f ("pinctrl: samsung: Add the support the multiple IORESOURCE_MEM for one pin-bank") Signed-off-by: Wei Yongjun --- drivers/pinctrl/samsung/pinctrl-samsung.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 3bc925f..9c03eab 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -1009,7 +1009,7 @@ samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d, res = platform_get_resource(pdev, IORESOURCE_MEM, i); virt_base[i] = devm_ioremap(&pdev->dev, res->start, resource_size(res)); - if (IS_ERR(virt_base[i])) + if (!virt_base[i]) return ERR_PTR(-EIO); }