From patchwork Wed May 4 11:17:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 67113 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp119749qge; Wed, 4 May 2016 04:17:33 -0700 (PDT) X-Received: by 10.98.90.130 with SMTP id o124mr11074128pfb.115.1462360653762; Wed, 04 May 2016 04:17:33 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vh16si4493970pab.164.2016.05.04.04.17.33; Wed, 04 May 2016 04:17:33 -0700 (PDT) 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=@nifty.com; 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 S1757760AbcEDLRb (ORCPT + 29 others); Wed, 4 May 2016 07:17:31 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:24290 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757197AbcEDLRa (ORCPT ); Wed, 4 May 2016 07:17:30 -0400 Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id u44BGoPD004867; Wed, 4 May 2016 20:16:51 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com u44BGoPD004867 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1462360611; bh=RNi4hwFfkBAwj0uPeFZ/9qZ+8IVzOsCT4Kbmp7A52nU=; h=From:To:Cc:Subject:Date:From; b=SFB4MbUQSWfrO/C5o2ZlXuxpyAW96zyHd3KcEKivXlJy6th/t6hJcA30e2hpnUBGf NwDlJCz4R/dT1YJYRhC58P4fSTpHQSd5w3VjdjEaeHv/C40aF6ChPYtC3FA01OL1Qa 39cb9JDScuWNxwdBcuST1Vq5hxhm3KZBt3ZY3IuzgTk9VgwhmTZO3QemU1Gz4XuaJ5 AOCPKQqYyEprQoRWgJCGIOhEiJnL5LQoBdyoujQ2asnxyFkvAuF25bLO+WN3OOyvqk QPh85ZYChcy4eoYe7qOWd2RO+thM4cS6pwnZ07YL1iaoFg/XfuBBDZfx3tiehe3ppA DYe8aKU+OB1aw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kernel@vger.kernel.org, Philipp Zabel Cc: Arnd Bergmann , Masahiro Yamada Subject: [PATCH] reset: allow to pass NULL pointer to reset_control_put() Date: Wed, 4 May 2016 20:17:51 +0900 Message-Id: <1462360671-13668-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, reset_control_put() just returns for error pointer, but not for NULL pointer. This is not reasonable. Passing NULL pointer should be allowed as well to make failure path handling easier. Signed-off-by: Masahiro Yamada --- drivers/reset/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/reset/core.c b/drivers/reset/core.c index 181b05d..7bb16d1 100644 --- a/drivers/reset/core.c +++ b/drivers/reset/core.c @@ -288,7 +288,7 @@ EXPORT_SYMBOL_GPL(reset_control_get); void reset_control_put(struct reset_control *rstc) { - if (IS_ERR(rstc)) + if (IS_ERR_OR_NULL(rstc)) return; module_put(rstc->rcdev->owner);