Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3571854pxm; Tue, 1 Mar 2022 00:39:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQOk2gcYIkq11hR1yRzB6QBxv7kk2wJUavCn5GNMyOZhLJLSEDOstR97KRYlr7H+n67JMx X-Received: by 2002:a05:6a00:cce:b0:4f3:64c8:e8ce with SMTP id b14-20020a056a000cce00b004f364c8e8cemr26410181pfv.25.1646123969813; Tue, 01 Mar 2022 00:39:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646123969; cv=none; d=google.com; s=arc-20160816; b=cReoVpU17JtOU4omRCE1rsp4mpDGQWC0ge0cV5cx5uM5r3eFPv5XIg1KOWdqZnNLlJ YJ6mj76l/F0IUTvGdzvPttGOebyhy7WOI0GfiOSpEvxjNk52LwjYXBPm5yaJQXGbIVU+ 7KTfQcughwK1jmOwe8ZOHYrLlls8RkTljMQ6dQOTitBYmnkkee9Fbcrq4DOhVjy0GQ73 jyrb8HCyByTWU9Qu73ZUoJkAC6eDgpv/0nqJ9IRfocn1FjUsClnxKq9/ClNTuL+hW9Vy sD5oKdkWR0A67spiyvVE53ZQ198SqW2qWfSlUmTF7CBRtoD2wADHilQV9BoqVkRpAgJk 4Ukw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HAJWfpHvA35GNnvL1LWjD04HmzMSdG5uVbOujl48wqs=; b=G4VyvkNKo01WcB3zLgiOKmQZGP2hfryZ/Q8tDmsDNc2IIRTkmEJ+euKnQnpqgHnZJy HnqLk11c8MnG/RfySUsE0X2xtXHSg1z6nLbe+l8cTR0/c4+d6ZKuzy/CiypmtCH9NFNr dxVRdPSCuN82kOSH8GHcP7we5eIiBqnsedii3uTlGjElOeACSzAvdZYph6A669HG1pl5 S+ITIEO5vZsbu5W6HZvpqUO39C+puE2RpMeNxVbD3dG6dlh7NR85XhfP9GduCpRepzcr XUPNCRVYzLkbD+wsiovCNTQO1Q6KXWWuG0A4exlV1wlJJQiaJkEq60yVwQQXu5x4dGGw wnNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rLllz5td; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020a633509000000b00375801de7b0si12238057pga.615.2022.03.01.00.39.14; Tue, 01 Mar 2022 00:39:29 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=rLllz5td; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232818AbiCAHMe (ORCPT + 99 others); Tue, 1 Mar 2022 02:12:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231542AbiCAHMc (ORCPT ); Tue, 1 Mar 2022 02:12:32 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B0517A9B1; Mon, 28 Feb 2022 23:11:52 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 9B7FC61215; Tue, 1 Mar 2022 07:11:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5306C340EE; Tue, 1 Mar 2022 07:11:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646118711; bh=10FFhhdusBJsRo3SaGVpNBEGQ/FHlM/hqY5zKkMJWBc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rLllz5tdAeismz+ePL6D+0NxSshab00OfZLcXkXL+XWcfEeC5js9YR6/yG2nwdD1x uS8nb02Iibkjeq8JRlQgWWylnZTOMIBkfpNTuJby3JCJIcehA7xqC2SoSzp1lGCR3d NWzmzeHtvHuCtyd15cqEsmvGNAbIbR4d1tepR1vgPLY6l3YucpN0JHlraWgug8rF49 xHN5UHXpgAWDl1E5NLEGZH5VcpTaAc0hHdiZWbsP3o+kynyniUCKaLoiagLKhtmP1W rFD5FEfgFlBiIcr9jSePQSZOj1K2BO8u40U8szPV+b9VxCKmoOsDELM/dmGbRQNsrB a3/TZUCnFtKBw== Date: Mon, 28 Feb 2022 23:11:49 -0800 From: Saeed Mahameed To: Colin Ian King Cc: Saeed Mahameed , Leon Romanovsky , "David S . Miller" , Jakub Kicinski , Nathan Chancellor , Nick Desaulniers , Roi Dayan , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] net/mlx5e: Fix return of a kfree'd object instead of NULL Message-ID: <20220301071149.msbfgs2kztcx4okl@sx1> References: <20220224221525.147744-1-colin.i.king@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20220224221525.147744-1-colin.i.king@gmail.com> X-Spam-Status: No, score=-7.5 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 On 24 Feb 22:15, Colin Ian King wrote: >Currently in the case where parse_attr fails to be allocated the memory >pointed to by attr2 is kfree'd but the non-null pointer attr2 is returned >and a potential use of a kfree'd object can occur. Fix this by returning >NULL to indicate a memory allocation error. > >Addresses issue found by clang-scan: >drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:3401:3: warning: Use of >memory after it is freed [unix.Malloc] > >Fixes: 8300f225268b ("net/mlx5e: Create new flow attr for multi table actions") >Signed-off-by: Colin Ian King Applied to net-next-mlx5 Thanks.