From patchwork Mon Apr 25 11:08:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ren Yu X-Patchwork-Id: 565950 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB982C433EF for ; Mon, 25 Apr 2022 11:09:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236301AbiDYLME (ORCPT ); Mon, 25 Apr 2022 07:12:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236148AbiDYLMA (ORCPT ); Mon, 25 Apr 2022 07:12:00 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4B9B1D64; Mon, 25 Apr 2022 04:08:54 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 38CC11E80D60; Mon, 25 Apr 2022 19:05:48 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HGFfNuF0KorW; Mon, 25 Apr 2022 19:05:45 +0800 (CST) Received: from localhost.localdomain (unknown [61.152.154.55]) (Authenticated sender: renyu@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 273F11E80CB5; Mon, 25 Apr 2022 19:05:45 +0800 (CST) From: Ren Yu To: tony@atomide.com Cc: aaro.koskinen@iki.fi, linux@armlinux.org.uk, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, liqiong@nfschina.com, yuzhe@nfschina.com, Ren Yu Subject: [PATCH] plat-omap: check return value of ioremap() Date: Mon, 25 Apr 2022 19:08:45 +0800 Message-Id: <20220425110845.415439-1-renyu@nfschina.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org When ioremap() failed,return err Signed-off-by: Ren Yu --- arch/arm/plat-omap/debug-leds.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c index 2b698d074874..bf5034e10f6e 100644 --- a/arch/arm/plat-omap/debug-leds.c +++ b/arch/arm/plat-omap/debug-leds.c @@ -109,6 +109,9 @@ static int fpga_probe(struct platform_device *pdev) return -ENODEV; fpga = ioremap(iomem->start, resource_size(iomem)); + if (!fpga) + return -ENOMEM; + writew_relaxed(0xff, &fpga->leds); for (i = 0; i < ARRAY_SIZE(dbg_leds); i++) {