Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp860769ybz; Sat, 25 Apr 2020 05:59:45 -0700 (PDT) X-Google-Smtp-Source: APiQypLVAJPSHmMx5//ADz6kwMBdyKJYjpVFz71pm+lKr+nydS3G8ldMUNdPZiyiRiA4tS5bhWdM X-Received: by 2002:a17:906:4eda:: with SMTP id i26mr11874762ejv.180.1587819585130; Sat, 25 Apr 2020 05:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587819585; cv=none; d=google.com; s=arc-20160816; b=JiLL7MoQ6QJAvVhqCB/q9hnNPK3gJcCDO2r5F+8olro1IG+GmsMqrCHfLSFmyAt+2p BLjn5r13YZNrBsmqkDNKnmI79u+wzh/6GG5HL9qAKi7HIewVsXFIdHI04u1PAPLz506G Zv0+dRBX7QwCo6cv/RCeVx1sj5MprvuUt4Lq1GcwVsNkKcAvmPjqNuh2A5frH3ivWASC Ofk69PaUQijgZl6B5Hw5bOJ3GBWJfZ8BcDjMevlRwMYIW8E4h5nN+kHsM4qHUWjpE6LG yVsqdm6plFE996uA4W7eERtzBeer/YQHugn0p+rysC9qnndvN/zl5NIZpmirvt0SPbAl ZkjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=OJs6nOWPM7GxxDhYSSl2MaH+M7ss8TdfBBLyxmUdc6U=; b=0vYI+iCDMV8VI2Nj+Zb71SYTj9dtudnltV1Q9ROqkpaJernC5bPyjM2XxVWAOmsOsJ Z6hGrVIxaCKKF1W5AlpuKOc6xJbBnW7IzNZt87EXFeEwQaUACRfXgmiiG7gIxEZa43Yz 4F4M5q1HtgBhzAiwJhPBJfwJwBQtoVR0NUcpMRiWUSUQzOLPp+84m0Yp1tqgqibgSJRc qw0GMY5gFjYVV9vuE8VlJPZoT1ZViGOYNddLllBLw3gXRjkWykRueCKZKk05+pnmL4Sy 9SdbB9O+Q8QCH1biNK2zE7PSbGg5005NBZjsfnQaTdA6JvV4/uDjP6rvmuLI1vJKHqSa 476A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ArzQ62dD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l4si5031718ede.294.2020.04.25.05.59.22; Sat, 25 Apr 2020 05:59:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ArzQ62dD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726126AbgDYM5s (ORCPT + 99 others); Sat, 25 Apr 2020 08:57:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726097AbgDYM5r (ORCPT ); Sat, 25 Apr 2020 08:57:47 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B05FAC09B04B; Sat, 25 Apr 2020 05:57:47 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id q18so6001794pgm.11; Sat, 25 Apr 2020 05:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OJs6nOWPM7GxxDhYSSl2MaH+M7ss8TdfBBLyxmUdc6U=; b=ArzQ62dDlG0VVfaZ0mEBF6nr4VeuKO42k4lzxz1MP32ee14B2GfrO4A6fOt3KBiw0T IiE5HdHcrhsCm2HHtVAkENZnt6Yog1OkytjfsbfaOTcWGjwTqOva1sbaX+tnsX90hSDI oH8zL/6ie8j0c38R+/Xxaq8QBOTqn+TWUailMm8KJ39zI5s2WBJoRlZf4WoPlkmMMj6o orEIlETxlfooAyg7sbXNJfMUPBGRzmzSy4g6le8MR+djbQyfq7pc9u2NasnxcLgBfFKs jRYNuuQZtZ6rCJTbm2fBiV3uM2JdcWJHWt8rTt+WEupBPROzb2jwvDyrgS12ZH0wbJT9 b/oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OJs6nOWPM7GxxDhYSSl2MaH+M7ss8TdfBBLyxmUdc6U=; b=JjOfPBEXVKpHsc5B3mhGRipMmx40qV06g0ajSnm/cq7K3G9x3K1D18seS4R+MMr3BR Qpy/S6PpLEUxtLbB+fzate+IPpf6WnlVdmkFuzEdbzo0sQOZvuTDOInuA2gb02p/HoZZ gWimKHP3JE9eQLvtlYvB7dGVDQ/Xesv+KdIxLruayC4NNo2bIvSuqbHiG8dh3Ds4WnbK A+ZitVWyvA7EkT+kCHGWiFELazojsDOaykncj8Hx0D+mfSNgP7A85baPfQOgLgRVIeQ1 aA2HwQmPo7C/2NZ2K9yVe6cPP9YV8LZHgOaeE/t4CSzBwxMHaRxWTG8T8ktn4fxv8WYT qmzw== X-Gm-Message-State: AGi0PuaSSz3vywODcs6fBBZXXWF700eZVlDNdtn0CvvcZbb/FTw6lQeF 1d6YuuwtEEbPYcmDKozwcfQ= X-Received: by 2002:aa7:8ec1:: with SMTP id b1mr14774164pfr.103.1587819467128; Sat, 25 Apr 2020 05:57:47 -0700 (PDT) Received: from localhost ([176.122.158.64]) by smtp.gmail.com with ESMTPSA id b7sm8064794pft.147.2020.04.25.05.57.45 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Apr 2020 05:57:46 -0700 (PDT) From: Dejin Zheng To: davem@davemloft.net, paul.walmsley@sifive.com, palmer@dabbelt.com, nicolas.ferre@microchip.com, yash.shah@sifive.com, netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Dejin Zheng , Andy Shevchenko Subject: [PATCH net v1] net: macb: fix an issue about leak related system resources Date: Sat, 25 Apr 2020 20:57:37 +0800 Message-Id: <20200425125737.5245-1-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A call of the function macb_init() can fail in the function fu540_c000_init. The related system resources were not released then. use devm_ioremap() to replace ioremap() for fix it. Fixes: c218ad559020ff9 ("macb: Add support for SiFive FU540-C000") Cc: Andy Shevchenko Signed-off-by: Dejin Zheng --- drivers/net/ethernet/cadence/macb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index a0e8c5bbabc0..edba2eb56231 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4178,7 +4178,7 @@ static int fu540_c000_init(struct platform_device *pdev) if (!res) return -ENODEV; - mgmt->reg = ioremap(res->start, resource_size(res)); + mgmt->reg = devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (!mgmt->reg) return -ENOMEM; -- 2.25.0