From patchwork Thu Feb 5 05:33:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sonic zhang X-Patchwork-Id: 5781051 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4D8FB9F30C for ; Thu, 5 Feb 2015 05:36:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7401420268 for ; Thu, 5 Feb 2015 05:36:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9302120259 for ; Thu, 5 Feb 2015 05:36:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750860AbbBEFgu (ORCPT ); Thu, 5 Feb 2015 00:36:50 -0500 Received: from mail-by2on0095.outbound.protection.outlook.com ([207.46.100.95]:22508 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750734AbbBEFgt (ORCPT ); Thu, 5 Feb 2015 00:36:49 -0500 Received: from BY2PR03CA001.namprd03.prod.outlook.com (10.255.93.18) by DM2PR0301MB0749.namprd03.prod.outlook.com (25.160.97.145) with Microsoft SMTP Server (TLS) id 15.1.75.20; Thu, 5 Feb 2015 05:36:48 +0000 Received: from BY2FFO11FD048.protection.gbl (10.255.93.4) by BY2PR03CA001.outlook.office365.com (10.255.93.18) with Microsoft SMTP Server (TLS) id 15.1.81.19 via Frontend Transport; Thu, 5 Feb 2015 05:36:47 +0000 Received: from nwd2mta2.analog.com (137.71.25.57) by BY2FFO11FD048.mail.protection.outlook.com (10.1.15.176) with Microsoft SMTP Server (TLS) id 15.1.87.10 via Frontend Transport; Thu, 5 Feb 2015 05:36:47 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.72.140]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id t158il45007171 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 5 Feb 2015 03:44:47 -0500 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS7.ad.analog.com (10.64.72.140) with Microsoft SMTP Server id 14.3.210.2; Thu, 5 Feb 2015 00:35:31 -0500 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id t155ZQis016955; Thu, 5 Feb 2015 00:35:30 -0500 Received: from nine.ad.analog.com (unknown [10.99.24.95]) by linux.site (Postfix) with ESMTP id 5DC4A3B00E7A; Wed, 4 Feb 2015 14:39:02 -0700 (MST) From: Sonic Zhang To: Steven Miao , CC: Dmitry Torokhov , , Sonic Zhang Subject: [PATCH] bfin: check if an empty array pointer is passed to pinmux request API Date: Thu, 5 Feb 2015 13:33:54 +0800 Message-ID: <1423114434-10063-1-git-send-email-sonic.adi@gmail.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 130675882074754462; (52f37747-95c3-483a-bd05-08d153b03fac); () Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 137.71.25.57 as permitted sender) Authentication-Results: spf=softfail (sender IP is 137.71.25.57) smtp.mailfrom=sonic.adi@gmail.com; lists.sourceforge.net; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:137.71.25.57; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(81442002)(50226001)(105596002)(77156002)(62966003)(48376002)(76482003)(50466002)(33646002)(87572001)(36756003)(50986999)(82202001)(73972006)(6806004)(19580405001)(229853001)(19580395003)(92566002)(86362001)(77096005)(55446002)(83322999)(46102003)(73392002)(87936001)(47776003)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0749; H:nwd2mta2.analog.com; FPR:; SPF:SoftFail; MLV:sfv; LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0749; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:DM2PR0301MB0749; X-Forefront-PRVS: 0478C23FE0 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(401004)(400005); SRVR:DM2PR0301MB0749; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2015 05:36:47.1790 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[137.71.25.57] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0749 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sonic Zhang to avoid possible indigestion Signed-off-by: Sonic Zhang --- arch/blackfin/kernel/bfin_gpio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index a017359..153841f 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c @@ -730,6 +730,8 @@ int peripheral_request_list(const unsigned short per[], const char *label) u16 cnt; int ret; + if (per == NULL) + return -ENODEV; for (cnt = 0; per[cnt] != 0; cnt++) { ret = peripheral_request(per[cnt], label); @@ -778,6 +780,8 @@ EXPORT_SYMBOL(peripheral_free); void peripheral_free_list(const unsigned short per[]) { u16 cnt; + if (per == NULL) + return; for (cnt = 0; per[cnt] != 0; cnt++) peripheral_free(per[cnt]); }