From patchwork Wed Jun 26 10:09:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 11017391 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4AAD56C5 for ; Wed, 26 Jun 2019 10:11:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36FDB285F0 for ; Wed, 26 Jun 2019 10:11:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B3AE285D5; Wed, 26 Jun 2019 10:11:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF5F7285F0 for ; Wed, 26 Jun 2019 10:11:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726768AbfFZKL5 (ORCPT ); Wed, 26 Jun 2019 06:11:57 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:46754 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbfFZKL4 (ORCPT ); Wed, 26 Jun 2019 06:11:56 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5QA8X51079437; Wed, 26 Jun 2019 10:11:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=0rjPnFf/3usKiUcf+Z1GXvs1dO9my6qw/hTowI4egCU=; b=Cp54Xyno+NH+L2Nhd2qmKhk3hX5L1vYWl2kM53ciZYxx/9JXp88t7U5Jy3P1cs3L/TpR efKPP3hcXLPrki5bRkol5IlEGbWv+jJAl/U1M565aRvUTVDlIpK4VT7KA4jcVOnwVp2k snMKFGrEso5I+gwqqtGV1I2NBRZYmklZgmfKlgNkNywBWSaNStwFKM0jXPJG+oaMrjCU KhFnqr+/1gOAlZMbZTaDlCzhRODoKhoeWWruEHWttk3hztjDheD2GfcqNpIYCdhOa9rU dZb0ezIgLT4bzvHdmL//2SIf1/jNoCGoK4Lb9i46XL3iULcHuQl/+VKFtJzxDzvEfjrU KQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2t9cyqhbf1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jun 2019 10:11:39 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5QA9WR3171338; Wed, 26 Jun 2019 10:09:39 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 2t9accm7vj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jun 2019 10:09:38 +0000 Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x5QA9XVK032710; Wed, 26 Jun 2019 10:09:33 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 26 Jun 2019 03:09:33 -0700 Date: Wed, 26 Jun 2019 13:09:26 +0300 From: Dan Carpenter To: Kalle Valo , Philip Rakity Cc: Allison Randal , Lubomir Rintel , libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] libertas: Fix a double free in if_spi_c2h_data() Message-ID: <20190626100926.GD3242@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.10.1 (2018-07-13) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9299 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906260122 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9299 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906260122 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The lbs_process_rxed_packet() frees the skb. It didn't originally, but we fixed it in commit f54930f36311 ("libertas: don't leak skb on receive error"). Signed-off-by: Dan Carpenter --- drivers/net/wireless/marvell/libertas/if_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/marvell/libertas/if_spi.c b/drivers/net/wireless/marvell/libertas/if_spi.c index 27067e79e83f..e38f02d1f2e4 100644 --- a/drivers/net/wireless/marvell/libertas/if_spi.c +++ b/drivers/net/wireless/marvell/libertas/if_spi.c @@ -772,7 +772,7 @@ static int if_spi_c2h_data(struct if_spi_card *card) /* pass the SKB to libertas */ err = lbs_process_rxed_packet(card->priv, skb); if (err) - goto free_skb; + goto out; /* lbs_process_rxed_packet() frees skb */ /* success */ goto out;