Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1610659ybj; Wed, 6 May 2020 01:45:59 -0700 (PDT) X-Google-Smtp-Source: APiQypJXLsX1RNO8bnF2N60wStgLQVeEoTCK8B3bvwiQ6vyA8TV4PVS3KF2k4nERTwh1aj14ZYzJ X-Received: by 2002:a17:906:16ce:: with SMTP id t14mr6472734ejd.366.1588754759648; Wed, 06 May 2020 01:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588754759; cv=none; d=google.com; s=arc-20160816; b=Kp89L0x+mjkX2ndR3/PbxZz522j5THSY6sTSU5grYGNqamR9VN/GyGauyq++Za07oe BYa9jZ9KdNMTaJ1QUEpLhqHvPAb4YEcVhYzbmgES7JJ59T2o6XdDgEj0+ifcHqBi8JNp vlQNciLc+FK9vFZYJ8rHHkQZiCE1uvG36mnL/dZSIajHhZyNLA07SCmG9hN+5W/He4kf Ckol51/lEq+6OxAoIIZ8s4dWfNKSe7qfs5hzFtGBjSDa5ZEbeitx6yglZiIM/rRhxjrN cMyIGa8Ro9iA1vrDpyG00VefYB1gWrCp56YymYfgqEFhbT62K5cPGQ3V/befOkFHcH/z 8BMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:user-agent:cc:to :references:in-reply-to:from:subject:content-transfer-encoding :mime-version:dmarc-filter:dkim-signature; bh=A0uHUic2syQujRpdYODhDdBPb69QIhvyQafAGfZ0Y/U=; b=vwXvE65qK341rCsnHE9klUQ0FLaypKHKiKiIzfhKC4fp581Jvm0seXaKU1Mf0g2NEK W/e80MstTPyfVOgpdr1ckZpPOg5Kyyu+ooCSDYmIQghWj8hlmqW1Ivz8Frt/z13TVpSH cwVXPFh2AE+hc2pPRfIwGYRtpY4iOXR6IzZNNGCa0ofJhGhXHrunJSdOWqdXt6fR5gIa Q5x6B3OxMZZMCq9CcPIRenyljup9ceBoa1FuWh3CX7B80hDkrrBIRvlhL6zb+m6t5EsK TdDCbv7TXx3eQw+L1HMRJeG/z1G90CkZCbWKPR/VwbmRTOEadwk4sINH7NDFyiuVsLfH MBQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=Z6r7Jr4G; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 r12si673735edw.278.2020.05.06.01.45.36; Wed, 06 May 2020 01:45:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=Z6r7Jr4G; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728937AbgEFIoo (ORCPT + 99 others); Wed, 6 May 2020 04:44:44 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:42405 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728410AbgEFIon (ORCPT ); Wed, 6 May 2020 04:44:43 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1588754683; h=Date: Message-Id: Cc: To: References: In-Reply-To: From: Subject: Content-Transfer-Encoding: MIME-Version: Content-Type: Sender; bh=A0uHUic2syQujRpdYODhDdBPb69QIhvyQafAGfZ0Y/U=; b=Z6r7Jr4Gp+MiOwjmefS73PKiNxXg/h9k11AAet/tFxqOWNgw1oUlNkzXYSXJvB+4esejl9ud daF3MO9734p0mpXYbHV4o1S6n6lsvD+l24l8JO8KxHKi+Qn1mu0fNl8fCbnaiLKwPiYWRgSw HRheeCFlgWMTBS82bwdWEHBIP8I= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5eb278fa.7f72dee7dea0-smtp-out-n03; Wed, 06 May 2020 08:44:42 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A123EC433BA; Wed, 6 May 2020 08:44:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=0.5 required=2.0 tests=ALL_TRUSTED,MISSING_DATE, MISSING_MID,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 28297C433BA; Wed, 6 May 2020 08:44:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 28297C433BA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.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: [PATCH] libertas_tf: avoid a null dereference in pointer priv From: Kalle Valo In-Reply-To: <20200501173900.296658-1-colin.king@canonical.com> References: <20200501173900.296658-1-colin.king@canonical.com> To: Colin King Cc: "David S . Miller" , Lubomir Rintel , Steve deRosier , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org User-Agent: pwcli/0.1.0-git (https://github.com/kvalo/pwcli/) Python/3.5.2 Message-Id: <20200506084442.A123EC433BA@smtp.codeaurora.org> Date: Wed, 6 May 2020 08:44:42 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Colin King wrote: > From: Colin Ian King > > Currently there is a check if priv is null when calling lbtf_remove_card > but not in a previous call to if_usb_reset_dev that can also dereference > priv. Fix this by also only calling lbtf_remove_card if priv is null. > > It is noteable that there don't seem to be any bugs reported that the > null pointer dereference has ever occurred, so I'm not sure if the null > check is required, but since we're doing a null check anyway it should > be done for both function calls. > > Addresses-Coverity: ("Dereference before null check") > Fixes: baa0280f08c7 ("libertas_tf: don't defer firmware loading until start()") > Signed-off-by: Colin Ian King Patch applied to wireless-drivers-next.git, thanks. 049ceac308b0 libertas_tf: avoid a null dereference in pointer priv -- https://patchwork.kernel.org/patch/11523055/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches