Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2810746rwd; Mon, 29 May 2023 00:53:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6S+vteByH7iKgd4YMkoBgdIKURgIhcUWtWzzBpUSjw3f1V8fqT50N4G50a5Kutw3mRZU2x X-Received: by 2002:a17:90b:4c11:b0:253:9374:6976 with SMTP id na17-20020a17090b4c1100b0025393746976mr10657586pjb.32.1685346825729; Mon, 29 May 2023 00:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685346825; cv=none; d=google.com; s=arc-20160816; b=swOCsUcF87LTE6LUfMnIhjMsKIX104xhrx6Uryd6foIsAKfxhDZftiKcIY7F/ccLg/ 6LgALFgb8y0hr8zTkAY/0dvNiGW7LMZ3NmHO3wk5+kn3BT6m/3PwdVNZmplJ3nIwLuZR bge/dt1Ns/BmfbaYYGqM5Ftn4IJGcfldXoYGwr7sfZ1TKlfs8Wvpgzxd/PtwkoUj3VJy uoBc07oOxh1H/fuUvgPWLOTEuYSPAl1Xb542SfN9bGzVVw3ws4p9FdI2QJgxUhoVLxJZ aEmx5rPxgd+42HPzyDee/sSkY1IVYEeYu+7Q6T7Ts3R4MEwIF6CmRs1YtWAIiZdMboZP rBXg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=2bdE5rxx0WNW70pykzA3LEgDROeECRTKYNJpXeGJheA=; b=SbcEtZ6TPNo4L0krzwoGm2F8dsK+OfoB1NjpbPt8iKqqWDMqepN5gz249FimQq0+1j kxSC2pZIZPCxJESYJJzM6SofT2aS0YkKwGPU7fQR9eewpYWrvtfdvYjJunezN7IHRqz3 cfarE+gqF0mag6hTS4sg/8VMrb3qJVUmfaAaC6rl3k9p6D0jNUFWI9cCaOtMzV5xyiPK woWzWnITTwqtAl/GBkO5JHNKdUipGFpovfSnysFOCflQJ2UwVsnN8T6dG/v2JKxn5dxq c8TfXfMok6d5J5sf71M2tI/oSLl+woYXrZHnX1+ANI/aAWa2KpZo6Xj5VJq+cBF3WKvg 3h0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="Cd9iq3K/"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jx20-20020a17090b46d400b0024e1a6c7f82si2954628pjb.80.2023.05.29.00.53.33; Mon, 29 May 2023 00:53:45 -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=@wanadoo.fr header.s=t20230301 header.b="Cd9iq3K/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230342AbjE2HfX (ORCPT + 99 others); Mon, 29 May 2023 03:35:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbjE2HfV (ORCPT ); Mon, 29 May 2023 03:35:21 -0400 Received: from smtp.smtpout.orange.fr (smtp-28.smtpout.orange.fr [80.12.242.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D1D4A7 for ; Mon, 29 May 2023 00:35:20 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 3XPKqHvCt7PLm3XPKqcUIc; Mon, 29 May 2023 09:35:13 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1685345713; bh=2bdE5rxx0WNW70pykzA3LEgDROeECRTKYNJpXeGJheA=; h=From:To:Cc:Subject:Date; b=Cd9iq3K/CU8lcBda2pvGwM8YS8As0QUQU9FdZ5ldnukC40VE3f0SzxYU5LOuKwGvx hVP5ReGttXo7LC71uSjjMO38DQ6S8N0zcoirt+/GPGacR2L55UAJYZGnuk5GeS3h77 Z7avrHlEZM8W2qmTeHLY3QqK7p+3atNl1ixZyxJsbUzLDjs2qysoL+ORkAXyeRAwkb +GIMo6vGGsKR/MzzlL7LPO2nj+nN7g5+5Mlm9sVNXKmnbS2lFZ97+nreUdSlPno89j sCp40vhU8/yCOin6MujsXWCujiGjP5o70epm/YUmfQI0sPSr6yr/CCFKpD0LR7g95Q PRifGMxA9exbg== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 29 May 2023 09:35:13 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , virtualization@lists.linux-foundation.org, linux-scsi@vger.kernel.org Subject: [PATCH] scsi: virtio_scsi: Remove a useless function call Date: Mon, 29 May 2023 09:35:08 +0200 Message-Id: <08740635cdb0f8293e57c557b22e048daae50961.1685345683.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,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 'inq_result' is known to be NULL. There is no point calling kfree(). Signed-off-by: Christophe JAILLET --- drivers/scsi/virtio_scsi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 58498da9869a..bd5633667d01 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -338,10 +338,8 @@ static int virtscsi_rescan_hotunplug(struct virtio_scsi *vscsi) int result, inquiry_len, inq_result_len = 256; char *inq_result = kmalloc(inq_result_len, GFP_KERNEL); - if (!inq_result) { - kfree(inq_result); + if (!inq_result) return -ENOMEM; - } shost_for_each_device(sdev, shost) { inquiry_len = sdev->inquiry_len ? sdev->inquiry_len : 36; -- 2.34.1