Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1005845ybh; Wed, 22 Jul 2020 20:14:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwY5BDDzchy628mp0CT2c0nDiPxkk63WdJOOv1woOCwxq+Bq1OWKVN4AhsKHNISSIGFfGP X-Received: by 2002:a17:906:1402:: with SMTP id p2mr2376414ejc.126.1595474079517; Wed, 22 Jul 2020 20:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595474079; cv=none; d=google.com; s=arc-20160816; b=dW5R8VPZaIA+ph3xE5LywL9pAdktxK2gBnjgCKXEiPpX+utLiXdwHCEqU21lDILKJD Pq1kfR3yCybQPNpwBYcry1iQmi6HRGtio9aDRJqlETO4C64VcJsAz7DDXiJLmXTfKPx4 G3mP8n91+qrc+CjAjGNiwKAVyDd+WRfW2+aK1gCxkJkhW1GRu9HNRRpm3Jpn39RfAwJ4 ScV6NwhmNdHp4Pc0CPnKfhgxeEf8l6FPSosYiXiIllafM7qMt/J0m1dfywWkPobARJ/0 I5DOTDhgpnSc0CDMQ10NaHI/stj5SMueqiA9SwVUlan2hGvyErRKCb+coCI6gmJzJf+g PexQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=WgKKqYdB+r2PuZiQsG1olYezPWTeDYzUJJiU9ocmdmg=; b=TAJDyRF6ogiXIHp81o5KMAAPIY7rLPubuZcA2FMutRd7t6NbcVNaYxgAl5Xmuj2uYD h45jiKzgmS+gTfA3LDCP5kUGB93hhUqAvNTKXTmK/o/CsF9uvy/FMyeSDbmQ6XSVIW0p gDrbZ/h4gM46nLCSs1h2nUWOxcx0BEOJu5McRHyNRaEIY9JyXUXWsJJ2X5qhoDPDZn4y MgaymIQ8Y8yTbgP5xtCfh18aMZt4TSLpcjymAS5eufdKfJVKOsnrquNaqkwQ1PsdqGxY wT3fDlPi6BkGdF6QZSYNG9CYWksp0WNejIbGKc1F71MNQ7yrvMf0bNp92uXYBGBiIHq8 xPqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z11si1215299ejo.189.2020.07.22.20.14.17; Wed, 22 Jul 2020 20:14:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387412AbgGWDNs (ORCPT + 99 others); Wed, 22 Jul 2020 23:13:48 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:41442 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728902AbgGWDNs (ORCPT ); Wed, 22 Jul 2020 23:13:48 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A0FEC2F2316F860034BF; Thu, 23 Jul 2020 11:13:45 +0800 (CST) Received: from huawei.com (10.175.104.57) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Thu, 23 Jul 2020 11:13:42 +0800 From: Li Heng To: , CC: , Subject: [PATCH -next] um: Remove redundant NULL check Date: Thu, 23 Jul 2020 11:15:16 +0800 Message-ID: <1595474116-3305-1-git-send-email-liheng40@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.104.57] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix below warnings reported by coccicheck: ./arch/um/drivers/vector_user.c:403:2-7: WARNING: NULL check before some freeing functions is not needed. Fixes: bc8f8e4e6e7a ("um: Add a generic "fd" vector transport") Signed-off-by: Li Heng --- arch/um/drivers/vector_user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/um/drivers/vector_user.c b/arch/um/drivers/vector_user.c index c4a0f26..e836d49 100644 --- a/arch/um/drivers/vector_user.c +++ b/arch/um/drivers/vector_user.c @@ -399,8 +399,7 @@ static struct vector_fds *user_init_fd_fds(struct arglist *ifspec) fd_cleanup: if (fd >= 0) os_close_file(fd); - if (result != NULL) - kfree(result); + kfree(result); return NULL; } -- 2.7.4