From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752955AbdFMHCQ (ORCPT ); Tue, 13 Jun 2017 03:02:16 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:45300 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752320AbdFMHCO (ORCPT ); Tue, 13 Jun 2017 03:02:14 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B93E8606DC Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [wireless-next] qtnfmac: check band before allocating cmd_skb to avoid resource leak From: Kalle Valo In-Reply-To: <20170602154045.28948-1-colin.king@canonical.com> References: <20170602154045.28948-1-colin.king@canonical.com> To: Colin Ian King Cc: Igor Mitsyanko , Avinash Patil , Sergey Matyukevich , Dmitrii Lebed , Huizhao Wang , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org User-Agent: pwcli/0.0.0-git (https://github.com/kvalo/pwcli/) Python/2.7.12 Message-Id: <20170613070213.64C55606DC@smtp.codeaurora.org> Date: Tue, 13 Jun 2017 07:02:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Colin Ian King wrote: > From: Colin Ian King > > The current code allocates cmd_skb and then will leak this if band->band > is an illegal value. It is simpler to sanity check the band first before > allocating cmd_skb so that we don't have to free cmd_skb if an invalid > band occurs. > > Detected by CoverityScan, CID#1437561 ("Resource Leak") > > Signed-off-by: Colin Ian King > Reviewed-by: Igor Mitsyanko Patch applied to wireless-drivers-next.git, thanks. bc0384eedb66 qtnfmac: check band before allocating cmd_skb to avoid resource leak -- https://patchwork.kernel.org/patch/9762863/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches