From mboxrd@z Thu Jan 1 00:00:00 1970 From: Colin King Subject: [PATCH] net: caif: remove redundant null check on frontpkt Date: Fri, 14 Sep 2018 18:19:16 +0100 Message-ID: <20180914171916.21298-1-colin.king@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Cc: kernel-janitors@vger.kernel.org, netdev@vger.kernel.org To: Dmitry Tarnyagin , "David S . Miller" Return-path: Received: from youngberry.canonical.com ([91.189.89.112]:37331 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbeINWep (ORCPT ); Fri, 14 Sep 2018 18:34:45 -0400 Sender: netdev-owner@vger.kernel.org List-ID: From: Colin Ian King It is impossible for frontpkt to be null at the point of the null check because it has been assigned from rearpkt and there is no way realpkt can be null at the point of the assignment because of the sanity checking and exit paths taken previously. Remove the redundant null check. Detected by CoverityScan, CID#114434 ("Logically dead code") Signed-off-by: Colin Ian King --- net/caif/cfrfml.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/caif/cfrfml.c b/net/caif/cfrfml.c index b82440e1fcb4..a931a71ef6df 100644 --- a/net/caif/cfrfml.c +++ b/net/caif/cfrfml.c @@ -264,9 +264,6 @@ static int cfrfml_transmit(struct cflayer *layr, struct cfpkt *pkt) frontpkt = rearpkt; rearpkt = NULL; - err = -ENOMEM; - if (frontpkt == NULL) - goto out; err = -EPROTO; if (cfpkt_add_head(frontpkt, head, 6) < 0) goto out; -- 2.17.1