Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1652862pxp; Thu, 17 Mar 2022 13:40:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjOvnQdw4A1HGCWLdVbuJwuqVqBjvZIJ4Oom71BKPeYhnKRRP4O94YxM/lzBF6aEKaD8z8 X-Received: by 2002:a63:8ac9:0:b0:380:8d8b:d01a with SMTP id y192-20020a638ac9000000b003808d8bd01amr5008164pgd.572.1647549632407; Thu, 17 Mar 2022 13:40:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647549632; cv=none; d=google.com; s=arc-20160816; b=A+QUG/rih0V1e4h9cT918cZfgElN46qM12U6ekhrBEugFwG7EKDl5J/0hdNr82DqyL 5eX3VQxbTGAw8wSTyACc+BSq8h72xBFVufAiUvmcNYdubPIJ9sU8NwS3OlNiCRvfB1JC fJS7VdWOdovSbNqKv02Kyi+b+vxzZluKlgwBfjUNOqKr5FtWfqUdNMMFRStZMRln2oRP BUyiekSTmlKmwstzghwWMlNN2nnR0wBNw/UIGn32aJ0fFAKT49ZZr71ow6TOr2piG2Gf l8ooAYPjiwhgGuOJ1/FYUSUOlkSPzgvR+zRzhqylcWBOOu0vM5VjOvRZO5TMx9aPjRAM E3MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4YtvgXJICP27GB52+Ab+ietzuejVGJubBLo9b4ieQ6g=; b=TVC0WplEK3i0+04uw6YPwtA6o9Hbm4oro9bGtN0Dfyw+JSqgov9m+efrIndnrk/A4z MPm+b/M2FRQF60NJ0rRBbUOGxcWcfSYb2gkAE7YHrvOfSZ3B+cmSK7slbNpzDy67T6tx gNXPD5i2L1RW8lm8eKlxPUzZ+eXOUtjk+6cU+BndlUZ/3cIn57coyRvmgG2r+9FZulDC HEf6Tg3WZQfOahSZjMeSDOn9nIjVq/Say80bTATXWzwxOLuaOY8Gjo0f9DzyWneFkQl0 6UAWCSPcoQ0kLOerAV3FAPHlyEV9EmRJNn6SXJNrVMFsm0tCCFRWr1pyqC132wdAH+YO qe8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fgjNHv63; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k5-20020a170902e90500b00153b2d16661si102357pld.617.2022.03.17.13.40.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 13:40:32 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fgjNHv63; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D9E331F0CB6; Thu, 17 Mar 2022 13:09:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231863AbiCQMuZ (ORCPT + 99 others); Thu, 17 Mar 2022 08:50:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233966AbiCQMuC (ORCPT ); Thu, 17 Mar 2022 08:50:02 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 349621F2DD7; Thu, 17 Mar 2022 05:48:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 798DDCE2340; Thu, 17 Mar 2022 12:48:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C29CC340E9; Thu, 17 Mar 2022 12:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647521298; bh=W2DYh/V6ODjkXeMpzuzD5sehvu38aMyPEf4Kpt2YQJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fgjNHv63TXtYWgv4Qj6l7SgMH17g2SpyPr94qw7YLi0Hv+9tnoL8ioNofvpFJJqko cm2zo+PLjZq22Q8ADlleRO+SKi0bxctLnXToi6sNIM9WywUQfAjQGurLzk9gokwGPr kjRRH+MOeviJt7eQi9/WAaEI83LUZdGbDiCSwKgQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, TOTE Robot , Jia-Ju Bai , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 36/43] atm: firestream: check the return value of ioremap() in fs_init() Date: Thu, 17 Mar 2022 13:45:47 +0100 Message-Id: <20220317124528.672465486@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220317124527.672236844@linuxfoundation.org> References: <20220317124527.672236844@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jia-Ju Bai [ Upstream commit d4e26aaea7f82ba884dcb4acfe689406bc092dc3 ] The function ioremap() in fs_init() can fail, so its return value should be checked. Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/atm/firestream.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index 5acb45985675..8995c39330fa 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c @@ -1677,6 +1677,8 @@ static int fs_init(struct fs_dev *dev) dev->hw_base = pci_resource_start(pci_dev, 0); dev->base = ioremap(dev->hw_base, 0x1000); + if (!dev->base) + return 1; reset_chip (dev); -- 2.34.1