Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2283763iof; Wed, 8 Jun 2022 01:23:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw4F8zBrS5aVHOpAzBi95O26DFsVYnXyT798OqhaPxNxdaJfbH4Eyqj7ee2+OmzvbJoPkh X-Received: by 2002:a17:90b:33cd:b0:1e6:8a38:f0b9 with SMTP id lk13-20020a17090b33cd00b001e68a38f0b9mr34484678pjb.64.1654676610670; Wed, 08 Jun 2022 01:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654676610; cv=none; d=google.com; s=arc-20160816; b=v1XbyDgaIfP6KPPEetjflaZRGeZdC5W9bKgX6q554PaUyL3Vk+sH8TKN7nRVQjAwhy 8kwWbFJgzNRHlAsDiB+rZEkq4AxcoXCFBFoTanMhb/xI+Dc6tPptcHJHYnfyxejzr5tm 4w3mEiNeAoLaeSAVjfzd3J7TVwjAH6imM39L5sMZzovxMeX0VZXgTmbSR/fbYDSRQVYT kP6LMHtWPRQwU+hY9aPTpq8yan4fNenNd06gq2iIgaHw6d66x8ZsDBgzzh9VbzO3mY8c iNCQ6TukOPHiOKnagrzAFo9Ryfff30OPVzOwxQxrwTpROa48P/feyydGMCPF1F77ZrHV C5AA== 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=GhhB4MsmRAceXnLEOsnvAmLepBWyMZXiGsf+sWPy8S8=; b=IoHto/x53/h+ZmBW/0rBDne1zJIvS8H80+PSAMoNekhqZLv+FVdO3x0wtc3p6OwM+Y kglozzivbMw5PKG2uIWgL9yHUUd9y9vSg6tnaT9fGmVEn9NbJEiT6JJmioKCrB816LLM 0Uh5Wc2NARKBdS7fx1HJnyQg6rypZ4ExCgDlJDBJISMMsihFy+ldOPAiy/Jc08qoiNWC PMeqX47qepqBXqVMJic062Fs4HRde11AKXeHcIXq+lS7NoptMsKK/k8gh2ZDhhbQ2Qyw gBMCAPjyTaGMpMsoaWgAT1Q5MMtsWQIiu636C9rydLJth7+VPlIgbJpk4FvH7AuTg19F vbqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Yk1y7sVq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f4-20020a636a04000000b003fd943bd41csi13936469pgc.30.2022.06.08.01.23.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 01:23:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Yk1y7sVq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 39FBD101916; Wed, 8 Jun 2022 00:54:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346313AbiFGR0G (ORCPT + 99 others); Tue, 7 Jun 2022 13:26:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346073AbiFGRVu (ORCPT ); Tue, 7 Jun 2022 13:21:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26FE3107891; Tue, 7 Jun 2022 10:21:15 -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 DC151B822B8; Tue, 7 Jun 2022 17:21:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C9E4C385A5; Tue, 7 Jun 2022 17:21:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622472; bh=0jYq7SrEBjoFSLyblsX/VqNdX518v94WFZHXPitwbSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yk1y7sVqh8Qoa0KmdHlXx5C+kanyhmpOJ4FPdR08L+xKsHsVmbGqPyFEyzmCHCW7U L0u/0dYPo81fhpt5j2HK3lL8erbvJVnfBk4JnzDyea1hDxl7BTOdpgdMeAtgOTzDus 8lixnrSdzx6ZbHPh64SBXBOmer0vKC9eETUpyQIk= 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 5.10 030/452] ipw2x00: Fix potential NULL dereference in libipw_xmit() Date: Tue, 7 Jun 2022 18:58:07 +0200 Message-Id: <20220607164909.445541971@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 d9baa2fa603b..e4c60caa6543 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c @@ -383,7 +383,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