Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp876654pxb; Fri, 22 Apr 2022 13:13:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmujta/UIw6xRIcLxiW8up9+Wz82n7MF4bx/UB7uGCQ46B35/r/bHA43HB7hgnZilSg4aD X-Received: by 2002:a17:90b:314b:b0:1d2:a346:7204 with SMTP id ip11-20020a17090b314b00b001d2a3467204mr17674816pjb.57.1650658409331; Fri, 22 Apr 2022 13:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650658409; cv=none; d=google.com; s=arc-20160816; b=tpKLDdBVG+oQDtDBILBDVywb0vxuo8pJFy2xd8P4u77g5d+ZSJhR/Mkc0G91OLBBTZ q3m6B+di2XB/aTrfJtA65fsAUuH+omGk0iTB1ursZ+zdjObdcWFueB7vaP22gxUGYIhz b/cCYOVFDz0dnV+0u6LvjIvyraxBUGRCgm07EEtolTf09H9mVX1Xc5Z09tthGw5eoocI vFI40MleipbyEsmZ1dYGl8kf7kyMKyyjpUKGAy0DhQsxUWfk79jl2iSmsRz/dVF2CTVr 4ekzm2MjW3SPlZLsM2jTUM1oGWJlUxtJ8j3Ec9VX7EKttU/y/OWx4H5JzpnggjlHuRhP QRfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=9V00dGnoNPypGAd9oUhHayhIjGVkFUkzhhTpsx9RJJs=; b=pH6AFeDRW6wjCwEjLAuYHpi9RFV1XJS4et0GuTNlTQLfhY5X1Ybhbun0kIqgVT3Giu IjnpjKvP8I32Qplv6fNvLuRa0apXeXXgiLlmofCAuo3M/fsgIX35p622tynqO0vqyzXj umg/mr5tqHPA12auwo5h6XaBEQ1rlmnlOBfUzv/GJ6/Q8ewVusp0RqtpN9RB4WZmvKQd JPvhuvcvG//JmvAvvxQbzXoyn9kWyfEjSd4IOoqrM9L0vxvVp/RjgOJTm/gZEbWuQXBj B5eBrobOOmqXL/q7+bUixuUZyV3At+1f0ji2Qs3R9e9mK3GyZDGxNc+9nyKX6MPGByVl bDLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=AVrFqNQB; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n124-20020a632782000000b003aa05c2b568si9205927pgn.133.2022.04.22.13.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 13:13:29 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=AVrFqNQB; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4C79884EC3; Fri, 22 Apr 2022 12:14:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1448574AbiDVOZ2 (ORCPT + 99 others); Fri, 22 Apr 2022 10:25:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1448333AbiDVOZ1 (ORCPT ); Fri, 22 Apr 2022 10:25:27 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EF481CFCE; Fri, 22 Apr 2022 07:22:33 -0700 (PDT) Received: from pendragon.ideasonboard.com (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C0A332F7; Fri, 22 Apr 2022 16:22:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1650637351; bh=wZifj+fUEBhv1yJJc/JjqYEk/AIauY1nIeQNs8Vfq5M=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=AVrFqNQBMQ08PG/1j2E2IaWmP4UHB6LrGSoilBvdiiHNDF4f3oq+QDV69K4C/Shdp mCMNZ6fua8sS684gPmro1TpZwBFhXKn/Khh3NszaDScNpybYCGgtO//roB6WZJ+9U7 CpFuJH56kH90x+3COBtf7kNi4VWYR/PqpQjx5hNA= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <1650607607-22893-1-git-send-email-baihaowen@meizu.com> References: <1650607607-22893-1-git-send-email-baihaowen@meizu.com> Subject: Re: [PATCH] media: m920x: Remove useless kfree From: Kieran Bingham Cc: Haowen Bai , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org To: Haowen Bai , Mauro Carvalho Chehab Date: Fri, 22 Apr 2022 15:22:28 +0100 Message-ID: <165063734898.3204481.2637889109438003078@Monstersaurus> User-Agent: alot/0.10 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no 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 Quoting Haowen Bai (2022-04-22 07:06:47) > After alloc fail, we do not need to kfree. >=20 Agreed, this shouldn't hurt as kfree will be a noop here but it is always null so redundant. May still warrant a fixes tag though, but it's not a critical fix. Reviewed-by: Kieran Bingham > Signed-off-by: Haowen Bai > --- > drivers/media/usb/dvb-usb/m920x.c | 1 - > 1 file changed, 1 deletion(-) >=20 > diff --git a/drivers/media/usb/dvb-usb/m920x.c b/drivers/media/usb/dvb-us= b/m920x.c > index 548199cd86f6..9df0ccfb654b 100644 > --- a/drivers/media/usb/dvb-usb/m920x.c > +++ b/drivers/media/usb/dvb-usb/m920x.c > @@ -277,7 +277,6 @@ static int m920x_i2c_xfer(struct i2c_adapter *adap, s= truct i2c_msg msg[], int nu > char *read =3D kmalloc(1, GFP_KERNEL); > if (!read) { > ret =3D -ENOMEM; > - kfree(read); > goto unlock; > } > =20 > --=20 > 2.7.4 >