Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2166435iof; Tue, 7 Jun 2022 21:57:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzh/QiSQKX0S4oTlcaJ47OMCcLz/Gvm9WqzjJeyQPVJfavCQBlG8qpfsEvCUJKLMdtEhCk2 X-Received: by 2002:aa7:8094:0:b0:505:b544:d1ca with SMTP id v20-20020aa78094000000b00505b544d1camr33108063pff.26.1654664274260; Tue, 07 Jun 2022 21:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654664274; cv=none; d=google.com; s=arc-20160816; b=W8y4TAfvw47lktcqIIOyFukn7ZkWaZvP+mZS8HgXJWSByHZvhRmKaIpEkqcsaQZCjS 1YK2fMqqiIt/KS4lPch8UoXtJpgdP/QFF60XQzzTIyYx7fyfD9cXUTuk6s6mbrqTw3k4 pxB5vOUDXHRbv6e2lOWLg3ro1DHQkC76dRFuxRWgkQtpK1eOfbuDzlSl7Kb81W/J593U uGpkllbz+5JjlpR5sdGgXGQh0zJ4rIhmtSkqBmn4RS7OBjELXsBV6W7IORsU/0jkT41u oJpDBevt8BhnWBVo3H+95Vz8e2Pb/N9PoaZKoSv70D9q1Opkz5EldXJTHbx4AOnZDdAc bT9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=estft1Gb389U69tzwkBGMEylheAxT7O7U7IIwTQASIU=; b=ubcBM52tKc4gYgRuSylk0PQ3o0swFhqHOK0Byi2jgs7uBojhAHpSQel/9J4aWKtqBO Bv5tCD4RLdzUSe1CtJkHwJQFCT04nN31g+WuD94y+1P+5m0Mib5RytdywguUrt9p9GLX uIK6wlSTTttSDzI3EBL9/9MFYd9ZeAKFZAQTTh63ZFW7dEaaFr7Ih6BxbmCJQBse6g4r 3+tYFhB2G+dbUNOR13MiR23nPYdzH4tIHEzlox5ujQsfeNpGKDfeoUGKN+Ew+4We3hqY ZFP4PNT/MobCUZeKwx7n8kCYSrxoren53UwnRGYb005FrB+C9xX78cTLkhz8mVgx6L6M e48A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ruc.edu.cn Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f4-20020a056a00228400b0051bff9453ddsi15113389pfe.98.2022.06.07.21.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:57:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ruc.edu.cn Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2A76115A876; Tue, 7 Jun 2022 21:26:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244723AbiFGOvz (ORCPT + 99 others); Tue, 7 Jun 2022 10:51:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236152AbiFGOvy (ORCPT ); Tue, 7 Jun 2022 10:51:54 -0400 Received: from smtp.ruc.edu.cn (m177126.mail.qiye.163.com [123.58.177.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3848F504B; Tue, 7 Jun 2022 07:51:48 -0700 (PDT) Received: from localhost.localdomain (unknown [202.112.113.212]) by smtp.ruc.edu.cn (Hmail) with ESMTPSA id F14B280053; Tue, 7 Jun 2022 22:51:43 +0800 (CST) From: Xiaohui Zhang To: Xiaohui Zhang , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] scsi: bvme6000_scsi: Fix a resource leak in bvme6000_device_remove() Date: Tue, 7 Jun 2022 22:51:38 +0800 Message-Id: <20220607145138.10766-1-xiaohuizhang@ruc.edu.cn> X-Mailer: git-send-email 2.17.1 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZCBgUCR5ZQVlLVUtZV1 kWDxoPAgseWUFZKDYvK1lXWShZQUhPN1dZLVlBSVdZDwkaFQgSH1lBWUJCSEtWSUNOH0gYH0tMHh pDVRMBExYaEhckFA4PWVdZFhoPEhUdFFlBWU9LSFVKSUtDTk1VS1kG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6K1E6Mhw5Ej06VhcqFTACDTUM DTlPC0xVSlVKTU5PTUpITktPTktOVTMWGhIXVQMSGhQTDhIBExoVHDsJDhhVHh8OVRgVRVlXWRIL WUFZSUtJVUpKSVVKSkhVSUpJWVdZCAFZQUpDTEg3Bg++ X-HM-Tid: 0a813ea670a52c20kusnf14b280053 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Similar to the handling of zorro7xx_remove_one in commit 16ed828b872d ("scsi: zorro7xx: Fix a resource leak in zorro7xx_remove_one()"), we thought a patch might be needed here as well. The error handling path of the probe releases a resource that is not freed in the remove function. In some cases, a ioremap() must be undone. Add the missing iounmap() call in the remove function. Signed-off-by: Xiaohui Zhang --- drivers/scsi/bvme6000_scsi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/bvme6000_scsi.c b/drivers/scsi/bvme6000_scsi.c index 8d72b25535c5..773254c9315b 100644 --- a/drivers/scsi/bvme6000_scsi.c +++ b/drivers/scsi/bvme6000_scsi.c @@ -97,6 +97,8 @@ bvme6000_device_remove(struct platform_device *dev) scsi_remove_host(host); NCR_700_release(host); + if (host->base > 0x01000000) + iounmap(hostdata->base); kfree(hostdata); free_irq(host->irq, host); -- 2.17.1