From patchwork Wed May 1 00:35:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 10924403 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 59D141395 for ; Wed, 1 May 2019 00:35:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41AD628AC0 for ; Wed, 1 May 2019 00:35:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 360BB28B06; Wed, 1 May 2019 00:35:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26F7528AC0 for ; Wed, 1 May 2019 00:35:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726514AbfEAAfh (ORCPT ); Tue, 30 Apr 2019 20:35:37 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34229 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726123AbfEAAfh (ORCPT ); Tue, 30 Apr 2019 20:35:37 -0400 Received: by mail-pg1-f193.google.com with SMTP id c13so6658922pgt.1; Tue, 30 Apr 2019 17:35:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=mK/2U6XmBVYKbHJt9nnr0L4DUMvX1gXQL2Vn7WRJlgA=; b=iEo+mr5hprLIwEr3/XiiyT4TNLjSDt63rR3STFMz07BLTLAeeQtx1+S/fJoMHYQOZc V/yOQ5aBt6YFBvx++4X9V52dbUcVwa5jDJc8CVJPuoOjfqmVg6201CNgn5xkQ5krJFnY +XXlUDlF/8zJ+XjS+vmLe4lriYZHY25QUsYFncuvP5okUiyVqAQVn3fPSbjb9fxd4cUv WjNZIrp8HGkqnLs9G9u/Yq4OXNjTBxlqy5PMe27DblqO1pbDusqLhIcmlILh1VvST0qk xjH0rJgcfeq9Nndp99ENmhWkGXNZAt1qo2D6SbCcoTYT2lDPvfrUIKQ0H3F0+5NWfnMp tY8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=mK/2U6XmBVYKbHJt9nnr0L4DUMvX1gXQL2Vn7WRJlgA=; b=aQzPW0FVpkqbir7DwaThLZNllPUCWsB8C0xfFAHFPjkPPRM0Q279YoJnkoJSu4f5p8 yx6f0F12IGczaDqwWuCCzjyAhQneCAJNMLWBUoHgn+d6BRYLi/Bf8tOjLvXQGdZcFCjg hdpjUVXLhNQQVac6bgz1luNYiBT6vgYtIBngc4aOqZ4FSM+RdZE89ADgaAjOrwfKnDFc 5Hke84F2s3WR4mOOXKiiHrZ9JywoEfwFc8gvRx9Ce9N8y8qG9hfpKuyqDMg3sCgwyKLy 9TX2yRCzdU1/J3k5TXzAVRhF+8iD0MEbc6ddVaZEShk60I4TBCxnDCnwmqqPX8lOCohz I2Uw== X-Gm-Message-State: APjAAAUEUVFjl8ftx44zT9S+4KST+9o9uNjY42QQSsAkpYatS/2P76lZ kqKnbUHzG8kGeFSe1BOwpg0= X-Google-Smtp-Source: APXvYqzmJPnGG+y1SzR33zIr2s9h3Ie9i2EMkkXVusVd/gyORnc7eLYtFqMSZZUlDdA7wJF/qs3YSg== X-Received: by 2002:a65:638f:: with SMTP id h15mr70709646pgv.147.1556670936930; Tue, 30 Apr 2019 17:35:36 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id h20sm99001780pfj.40.2019.04.30.17.35.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 17:35:36 -0700 (PDT) From: Guenter Roeck To: "David S . Miller" Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , "Gustavo A . R . Silva" Subject: [PATCH] usbnet: ipheth: Remove unnecessary NULL pointer check Date: Tue, 30 Apr 2019 17:35:33 -0700 Message-Id: <1556670933-755-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ipheth_carrier_set() is called from two locations. In ipheth_carrier_check_work(), its parameter 'dev' is set with container_of(work, ...) and can not be NULL. In ipheth_open(), dev is extracted from netdev_priv(net) and dereferenced before the call to ipheth_carrier_set(). The NULL pointer check of dev in ipheth_carrier_set() is therefore unnecessary and can be removed. Cc: Gustavo A. R. Silva Signed-off-by: Guenter Roeck --- drivers/net/usb/ipheth.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c index a01a71a7e48d..c247aed2dceb 100644 --- a/drivers/net/usb/ipheth.c +++ b/drivers/net/usb/ipheth.c @@ -241,8 +241,6 @@ static int ipheth_carrier_set(struct ipheth_device *dev) struct usb_device *udev; int retval; - if (!dev) - return 0; if (!dev->confirmed_pairing) return 0;