From patchwork Tue Oct 11 18:41:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 77522 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp155162qge; Tue, 11 Oct 2016 12:47:00 -0700 (PDT) X-Received: by 10.67.7.39 with SMTP id cz7mr9391910pad.20.1476215220587; Tue, 11 Oct 2016 12:47:00 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3si4525673paa.138.2016.10.11.12.47.00; Tue, 11 Oct 2016 12:47:00 -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 S1752708AbcJKTq5 (ORCPT + 27 others); Tue, 11 Oct 2016 15:46:57 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:33592 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752553AbcJKTqx (ORCPT ); Tue, 11 Oct 2016 15:46:53 -0400 Received: by mail-oi0-f68.google.com with SMTP id i127so2104736oia.0 for ; Tue, 11 Oct 2016 12:44:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lM0bIDfvzTKQk6cbmsIM4TsG2+RFvJkBMHqafOs7VmQ=; b=dZmx2zTvhMf1HAlQwxcWvjs7fVudADw7fXKzPh+db6Wb6sKK3y3yewTJwulIHemZp6 T2h8ApSKnpyP0vTydsyUunk2ArqU/MDBq+z/CRPpZ/klGIhoY+AAGYYtGs/cZQTNG5tu w8VwMX/q4SU0diUs8llBW7iK5pkYTGUp4+EpFn1PJ6uZk2avcVNd2JSKks+xV49ZU8M9 2qVRxyfDoQhGTPqsiscer0pSDeSbK5wT3t7D8/M/s+j4qQbiT9LcpeyEQCP5UX/Jm/0j QJTItqLw21SL+48KxzgO0KHvgACoFPrFBc86cx0ZSDLU+NmORkFiLHQZfnaYyhGHEVAE crvA== X-Gm-Message-State: AA6/9RkqPtn50e7sAYfL5gvqDsrFiSVZsjbaYOkwkBEG5lSziE1+YCLsM0R9iZlfzyDyEw== X-Received: by 10.202.74.197 with SMTP id x188mr3675465oia.155.1476211265341; Tue, 11 Oct 2016 11:41:05 -0700 (PDT) Received: from rob-hp-laptop.herring.priv (72-48-98-129.dyn.grandenetworks.net. [72.48.98.129]) by smtp.googlemail.com with ESMTPSA id s130sm1543049oif.3.2016.10.11.11.41.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Oct 2016 11:41:05 -0700 (PDT) From: Rob Herring To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Dan Carpenter Subject: [PATCH 2/2] driver core: fix smatch warning on dev->bus check Date: Tue, 11 Oct 2016 13:41:03 -0500 Message-Id: <20161011184103.17744-2-robh@kernel.org> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161011184103.17744-1-robh@kernel.org> References: <20161011184103.17744-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit d42a09802174 (driver core: skip removal test for non-removable drivers) introduced a smatch warning: drivers/base/dd.c:386 really_probe() warn: variable dereferenced before check 'dev->bus' (see line 373) Fix the warning by removing the dev->bus NULL check. dev->bus will never be NULL, so the check was unnecessary. Reported-by: Dan Carpenter Signed-off-by: Rob Herring --- drivers/base/dd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.10.0 diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 8937a7ad7165..d76cd97a98b6 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -384,7 +384,7 @@ static int really_probe(struct device *dev, struct device_driver *drv) if (test_remove) { test_remove = false; - if (dev->bus && dev->bus->remove) + if (dev->bus->remove) dev->bus->remove(dev); else if (drv->remove) drv->remove(dev);