Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2744936pxa; Tue, 25 Aug 2020 01:55:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEnkCObeHRiKFyGd38r0EeJKCWB7zoesKQxD2zc1koJwV1MMWwFAusmRS0C/LgycA6huVG X-Received: by 2002:a17:906:fcb3:: with SMTP id qw19mr9674904ejb.271.1598345713020; Tue, 25 Aug 2020 01:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598345713; cv=none; d=google.com; s=arc-20160816; b=fhJe3cygrQBLKMV9NeS2QzteupuS1A9q0kBHnz+nOMWaS6dic8zXa8ZW3MTizS8OUP oiKVqr+IJdeq0uANmTYr+rw2qE4AuT/c+pUkOmD3fw6RIZRWfETun8JtcWQUGxJUm1cY oW1mOmMe6/Ib6Fu/0Wa4MN0/zF/Kt3oVs5xGzUNGXVr+R0R7QpDLDKq+E3PCKs9FF4Dh pt5M5gL4pXvhrXHe0odXmO57bR4KAgpi1OTo265pRzvPf+zoehDp24EEurpzmyZ8oZeF 8aqtU0aHJbN9cqJWPejZthzIZ6Oi8PtNs8DD4TqA7pa+RqzwoBYabNXy4LRVr3iuKBuR lH3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=6VhONQDF3CMCMM3Xp+xAlF53cOcYZf4sfehKmNBWTcw=; b=mLdB6u9FVsZNAEJdC2wsh9r1YPXjfB0HDb8gFCp+DP3D6tNUvIzjwU23UszCj9Hifz bYKOrktKYMLI2Po7I5CrM8lBuZyQRmkLj8gsgndX6rc02bwSo5sX5Wmhj72th5itNtiD uv0vgEYrgudxh+VLB1HUr29XHyBV3l82Ctig9fyDRkJZ0/Zc/Tiqqc4pyLKj+6EAUnmM BGJR5menBwm+ezv0FiiG5PVvVuClzjVF4iQyPBUrHrPaizKIkT+cY6p/+C9Q+2lEs8R9 DQOQaJzO+1ZFDoclNNZdmOW9h1XZIJaIOkEFwaSoc2tuoXzAez7ISzFvEsVfmDMFRT6m U88A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n11si8592006edy.433.2020.08.25.01.54.49; Tue, 25 Aug 2020 01:55:13 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729058AbgHYG3T (ORCPT + 99 others); Tue, 25 Aug 2020 02:29:19 -0400 Received: from spam.zju.edu.cn ([61.164.42.155]:23388 "EHLO zju.edu.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728912AbgHYG3T (ORCPT ); Tue, 25 Aug 2020 02:29:19 -0400 Received: from localhost.localdomain (unknown [210.32.144.184]) by mail-app4 (Coremail) with SMTP id cS_KCgAnb_+sr0RfQp5LAQ--.5869S4; Tue, 25 Aug 2020 14:29:04 +0800 (CST) From: Dinghao Liu To: dinghao.liu@zju.edu.cn, kjlu@umn.edu Cc: Benjamin Herrenschmidt , Bartlomiej Zolnierkiewicz , Mathieu Malaterre , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] video: fbdev: radeon: Fix memleak in radeonfb_pci_register Date: Tue, 25 Aug 2020 14:29:00 +0800 Message-Id: <20200825062900.11210-1-dinghao.liu@zju.edu.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: cS_KCgAnb_+sr0RfQp5LAQ--.5869S4 X-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xof0/1tbiAgQDBlZdtPqDKgACst Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When radeon_kick_out_firmware_fb() fails, info should be freed just like the subsequent error paths. Fixes: 069ee21a82344 ("fbdev: Fix loading of module radeonfb on PowerMac") Signed-off-by: Dinghao Liu --- drivers/video/fbdev/aty/radeon_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c index 3fe509cb9b87..13bd2bd5c043 100644 --- a/drivers/video/fbdev/aty/radeon_base.c +++ b/drivers/video/fbdev/aty/radeon_base.c @@ -2307,7 +2307,7 @@ static int radeonfb_pci_register(struct pci_dev *pdev, ret = radeon_kick_out_firmware_fb(pdev); if (ret) - return ret; + goto err_release_fb; /* request the mem regions */ ret = pci_request_region(pdev, 0, "radeonfb framebuffer"); -- 2.17.1