Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp283824yba; Sat, 13 Apr 2019 00:31:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgbYkbRZhWCR9zMq8AbAHu1EEe7Mvg6ZcKwDVOtUIUKMigRPLuKBhCHtZvJbPHuzmHfnNm X-Received: by 2002:a63:bd52:: with SMTP id d18mr57876889pgp.52.1555140687408; Sat, 13 Apr 2019 00:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555140687; cv=none; d=google.com; s=arc-20160816; b=e5nsZNc50X+wBshlr6PtdJl1E2GjieAuwDQRMvLHdzyp4/MXAgZEvJ3NTjMf3OWDwE UrqcNY1SEvzX5EUpluuz37RoggF3hS8Rpet2s/vKL2Dynos6r9BWUqjE9X1noZiAZ20C E/nQNkjSPs55s4CTIFszq09x9AWb60Pj7Z+XanfZTWvvq/dAEJfl63cfxQ5+UujIfA8R jChO88JEhx9UzH8dJeYwGCBPZu44FW3jdfOmVkxwvX/5dZTnESuzWv1lKT3LAamzClP1 ++RkEAcNj2amyin32gWyOJK+xQQ0ppQM/uMHOFwNkKkyRD9fUPY3kugnfU6q4rNgxlnT dOrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=m3k6vLsAPcyYqtw2N6NBUwZhQ9ADiHPY4IWgLpIdZiA=; b=p2Dxso2Udhbvl9wkvGjM6066Va/2nYXCy6DJRaVz+nPFYPYG9zX0j+FMCRss9PA2CU QDEZJd/3Pb8Dv+Ki6P8iUjO3U95aIdnMcC889Z891gHfgJJ2UyDpGLq9eQ+z5DtauM8p i3oYumaE0kuKp4ROsPNlLIiFghTQTQ3I4q/bUxRgz//2ahNwypuLi11q3M7Sabq2MWwP gcKHBvrY5GNVJwlPtG93OHsyO2PPlrT4RH735AE+PVqFAH8t+5bY+QuIkCQSBRc0u9ly u/2Hw7jvkBDHR+2rWeIRl50uM8UQw2ZtNaQ/uFK8RmnDijB46s0ngxKB7qDA/BwBEyHc 6vaw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m88si27090401pfi.280.2019.04.13.00.31.11; Sat, 13 Apr 2019 00:31:27 -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; 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 S1727242AbfDMHaX (ORCPT + 99 others); Sat, 13 Apr 2019 03:30:23 -0400 Received: from www.osadl.org ([62.245.132.105]:36563 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727224AbfDMHaV (ORCPT ); Sat, 13 Apr 2019 03:30:21 -0400 Received: from debian01.hofrr.at (178.115.242.59.static.drei.at [178.115.242.59]) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id x3D7Sohc010572; Sat, 13 Apr 2019 09:28:56 +0200 From: Nicholas Mc Guire To: Russell King Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Mark Brown , Linus Walleij , Tony Lindgren , Mike Rapoport , Janusz Krzysztofik , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH 1/4 RFC] ARM: imx legacy: warn on failed allocation Date: Sat, 13 Apr 2019 09:23:30 +0200 Message-Id: <1555140213-1081-2-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1555140213-1081-1-git-send-email-hofrat@osadl.org> References: <1555140213-1081-1-git-send-email-hofrat@osadl.org> X-Spam-Status: No, score=-1.9 required=6.0 tests=BAYES_00,DATE_IN_FUTURE_96_Q, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on www.osadl.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Even in init the allocation can fail and thus should at least warn so that the cause can be identified. Signed-off-by: Nicholas Mc Guire --- Problem located with an experimental coccinelle script Note sure if there is a better solution as this is early in the boot process so not that could be done anyway but fuss - anyway unchecked allocation is not a good thing. Patch was compile-tested with: imx_v4_v5_defconfig (implies CONFIG_MACH_MX27ADS=y) (with some unrelated sparse warnings about unimplemented syscalls and a few checkpatch warnings - covered in the other patches) Patch is against 5.1-rc4 (localversion-next is 20190412) arch/arm/mach-imx/mach-mx27ads.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c index 6dd7f57..528846f 100644 --- a/arch/arm/mach-imx/mach-mx27ads.c +++ b/arch/arm/mach-imx/mach-mx27ads.c @@ -247,6 +247,7 @@ static void __init mx27ads_regulator_init(void) struct gpio_chip *vchip; vchip = kzalloc(sizeof(*vchip), GFP_KERNEL); + WARN_ON(!vchip); vchip->owner = THIS_MODULE; vchip->label = "LCD"; vchip->base = MX27ADS_LCD_GPIO; -- 2.1.4