From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26EF2C433EB for ; Mon, 27 Jul 2020 14:15:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01FAD2083B for ; Mon, 27 Jul 2020 14:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859346; bh=8uOWQna+xF+wALsfQe81pslny6LeDhpRhdbY+HKlN6s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=eIToaIxhy4RoiKm4wXeMxiZsFD/1WIO2osSl7CelXKKOr21NZxiviEX4K/mAoIJfF 142LVmAU6ilAG8mxu1fMwfVAXHBoL5TydYMwYwUDdq0hIL6aI6BLwkRm25ktLzw0/x x05/tnKiL7qfhO2TKUeuLeaFwOB+poM0ex5JDymo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730736AbgG0OPo (ORCPT ); Mon, 27 Jul 2020 10:15:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:42188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730728AbgG0OPl (ORCPT ); Mon, 27 Jul 2020 10:15:41 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B4562078E; Mon, 27 Jul 2020 14:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859341; bh=8uOWQna+xF+wALsfQe81pslny6LeDhpRhdbY+HKlN6s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K9uD9JjDv21fK+To9GhhJvBy0MjyWaKqMhC764zlH98iJmGxZjhyVV/z07DXN8izq bNPYIujXvHPJudEGVLlhEOyaOj0Bg6IK6OV+9KIW53bAoqWCG3GMuPdEK+Tcwcf/bD oPooKDawDjcqAHaW3aeGvPGbujSsetzDdDrJbJxs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 040/138] hippi: Fix a size used in a pci_free_consistent() in an error handling path Date: Mon, 27 Jul 2020 16:03:55 +0200 Message-Id: <20200727134927.368645377@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134925.228313570@linuxfoundation.org> References: <20200727134925.228313570@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit 3195c4706b00106aa82c73acd28340fa8fc2bfc1 ] The size used when calling 'pci_alloc_consistent()' and 'pci_free_consistent()' should match. Fix it and have it consistent with the corresponding call in 'rr_close()'. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/hippi/rrunner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c index 2a6ec53949666..a4b3fce69ecd9 100644 --- a/drivers/net/hippi/rrunner.c +++ b/drivers/net/hippi/rrunner.c @@ -1242,7 +1242,7 @@ static int rr_open(struct net_device *dev) rrpriv->info = NULL; } if (rrpriv->rx_ctrl) { - pci_free_consistent(pdev, sizeof(struct ring_ctrl), + pci_free_consistent(pdev, 256 * sizeof(struct ring_ctrl), rrpriv->rx_ctrl, rrpriv->rx_ctrl_dma); rrpriv->rx_ctrl = NULL; } -- 2.25.1