Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp598083iog; Mon, 13 Jun 2022 08:52:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sf8E/Y2zIQMhzcHlk/IZaNyfsI5m6+tLssKGXrzQRcifQ9bY3JEtlm0X1oWmqQQEFyBiaC X-Received: by 2002:a17:90a:6602:b0:1e3:17e:6290 with SMTP id l2-20020a17090a660200b001e3017e6290mr459460pjj.37.1655135532350; Mon, 13 Jun 2022 08:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655135532; cv=none; d=google.com; s=arc-20160816; b=qdquJ9fmQFGHeOaejQiKzRB6RiZNt+TiVtSwrSAHCxlfTzQxYtvhcQgFh5WF3+KY8h MBhM9GhNqUemDLHQd6FR8sDbphS7OJ4be8jP8eeweQrJVY6j7OR/wONTmJjs4eFD5Gpt i9Tx4FHl6xSgTz9+q9CipywV60mv1896M43TAB0NaxSGSKziqzouC02E2aLYnTGWJ0GH ooFTo8D1jaa/F72A3uzOCdOTMaCVW8SW/yVKTpdtpb0Bnvp1K2GJnNpncU6n95tfRMwR mJyafrIQUm6gjnQ1gfzzg1vMLJyUgZugKDRPX6T+4+no3TDboyZTbix2/NfFD6lHOh0V EaNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rIIQ4vHEIJ1tMP9t+ECj1k7AR+7ndI/ieubAYZSAEg0=; b=JUy1t3nnAJwjyUYD3XV5+InymctHCHZQWEwEug71heQDTgmgKd3hlpsITRYCPnkXtF p/IMZAEaCaw+DkAxhHbTEPuyIBN/rHx5kYhr5q5gRmTQBnI5nDj1LDCqRdI0UDiVeJ6O VUz5LvbKYn2/7a4XXkhGmVhYq9SzLcm9IyePFSpsVkWkgHXMNF4X4xb1bL0ENFxavpk8 jm+Vkif15TpPE+IaHy49SEIXgYZWWgik+Cijf0j6cyLQbDJmM9uhQeuxU9F7gh/puczX N+vbv1w9kMlOtQDuM4ADEpduZvzLTccoOyX3hEnIMEEI2FHVy6M3KszBWhqDUlCcZ97w LPiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jcnoALsA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v184-20020a6389c1000000b0040882f6ed9fsi3510058pgd.876.2022.06.13.08.51.58; Mon, 13 Jun 2022 08:52:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jcnoALsA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355883AbiFMLmN (ORCPT + 99 others); Mon, 13 Jun 2022 07:42:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354217AbiFMLe7 (ORCPT ); Mon, 13 Jun 2022 07:34:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 422814475E; Mon, 13 Jun 2022 03:48:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 56148B80E07; Mon, 13 Jun 2022 10:48:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4F40C34114; Mon, 13 Jun 2022 10:47:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655117279; bh=oPb496vJ6O8l9Viexv5dOp3zu04IOVFFRg10fGCG5Ig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jcnoALsAxH8d3GQ1WfHepkRPsDhI/2c3iFJnz/EOJWjn5PVOTN+aTRH6KqkLbF0qd XxQ+tEeyyzqh8hfLcDdTBYB5ZCCpSBXeElM3Y+hghq+RmolkkSlOOQdRR3y0m9BQyH y39oatPHsNWt9ym9fspVZGZB8i5QPToRqrTgHJxY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Haowen Bai , Kalle Valo , Sasha Levin Subject: [PATCH 4.19 013/287] ipw2x00: Fix potential NULL dereference in libipw_xmit() Date: Mon, 13 Jun 2022 12:07:17 +0200 Message-Id: <20220613094924.254867188@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094923.832156175@linuxfoundation.org> References: <20220613094923.832156175@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Haowen Bai [ Upstream commit e8366bbabe1d207cf7c5b11ae50e223ae6fc278b ] crypt and crypt->ops could be null, so we need to checking null before dereference Signed-off-by: Haowen Bai Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1648797055-25730-1-git-send-email-baihaowen@meizu.com Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/ipw2x00/libipw_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c index 84205aa508df..daa4f9eb08ff 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c @@ -397,7 +397,7 @@ netdev_tx_t libipw_xmit(struct sk_buff *skb, struct net_device *dev) /* Each fragment may need to have room for encryption * pre/postfix */ - if (host_encrypt) + if (host_encrypt && crypt && crypt->ops) bytes_per_frag -= crypt->ops->extra_mpdu_prefix_len + crypt->ops->extra_mpdu_postfix_len; -- 2.35.1