Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1784154imm; Thu, 20 Sep 2018 02:52:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdahL3POfyNvo1df0oxE1BECH/xnXTtOpj+iqGOPbW6pokdn88qIRjPSTSpctmQGQBSZB3pb X-Received: by 2002:a63:5558:: with SMTP id f24-v6mr7654088pgm.37.1537437121819; Thu, 20 Sep 2018 02:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537437121; cv=none; d=google.com; s=arc-20160816; b=jtfy1R7sr3bRHvdFLPFVwAZ4ixGoPXFM0rD549YSqMkji6Hz5CkJVZqKIWDxsZTNQE pdAirEP4osY8DW1AyWy3rNzIyAyPuqQE0mNSKYok0wEb23rA9BNKOU3gu817EtxsMGnU oCtjNw0qaJhm0e7bWpm8R9PCaCcmdOMhcKHTPlHpVY51U0c0KGSD+CJqnQZp6FDJ5dps WnHOLn6Zp+pSGZUZblI/E17omosFnztcT1ZIn9vl6pDzrNslIw5u51OAmnEYp99ynjJ4 4DlZibTTtv/62fhnjutlrZjDpqo4dD8tN0MeYhx52PQeoCJ8hzif7FNsCR/xXbY08MrO JFZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=smvw/Dl+lQWdF3ySagE+6fpIyw4HNZSclvTpd17InRA=; b=GRgKIQXqH0gYkYTZaVin51xqXoeWpOQpqEil2cent9ZjbIdS2swv/hZKR0RrbWzKog ckozvz02EA6u0tOemGF76IJR4X3G2OO+5SrZpI4EVsZq86RzGiWMpJ+3LguUbXxm0rUV 9sO1rtbKRhMg8xMbE7XOqolPme4ZLsFSLs5fVVeNQFyIYDFncuMWT/WQGLtVHRoJhnOT KgrJGASlu4bppDhJgzG+SEWNqnLjEG5S8uRoicWSdfnJO0Q0nyCaaYdEs/MiYqG+/FqJ zKAdu6UHrYiIHVLgUsDH1dSZPJNiswCtC0uzL/31tYaa0UJO7C8vPc2AypA7UvLqlL6s tI0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d22-v6si23387382pgb.180.2018.09.20.02.51.46; Thu, 20 Sep 2018 02:52:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732221AbeITPcy (ORCPT + 99 others); Thu, 20 Sep 2018 11:32:54 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:12632 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726177AbeITPcx (ORCPT ); Thu, 20 Sep 2018 11:32:53 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A2D2569083768; Thu, 20 Sep 2018 17:50:12 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.399.0; Thu, 20 Sep 2018 17:50:11 +0800 From: zhong jiang To: CC: , , , , Subject: [PATCH 4/6] net: nci: remove redundant null pointer check before kfree_skb Date: Thu, 20 Sep 2018 17:37:44 +0800 Message-ID: <1537436266-41955-5-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1537436266-41955-1-git-send-email-zhongjiang@huawei.com> References: <1537436266-41955-1-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kfree_skb has taken the null pointer into account. hence it is safe to remove the redundant null pointer check before kfree_skb. Signed-off-by: zhong jiang --- net/nfc/nci/uart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/nfc/nci/uart.c b/net/nfc/nci/uart.c index a66f102..4503937 100644 --- a/net/nfc/nci/uart.c +++ b/net/nfc/nci/uart.c @@ -192,10 +192,8 @@ static void nci_uart_tty_close(struct tty_struct *tty) if (!nu) return; - if (nu->tx_skb) - kfree_skb(nu->tx_skb); - if (nu->rx_skb) - kfree_skb(nu->rx_skb); + kfree_skb(nu->tx_skb); + kfree_skb(nu->rx_skb); skb_queue_purge(&nu->tx_q); -- 1.7.12.4