Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3304555imc; Wed, 13 Mar 2019 14:19:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxolfXIGoAfC/nj49HS0nSkzluY7YTaYriSpo5FXHcAsfyZP1jlC15wV0oR3YHnPtijwhgD X-Received: by 2002:a17:902:be09:: with SMTP id r9mr34439493pls.189.1552511989163; Wed, 13 Mar 2019 14:19:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552511989; cv=none; d=google.com; s=arc-20160816; b=m9LTNT6PjHWtkAgdpuv0MPOTrEObhE3LWLuc2LcoXQTzJDIuvm8Ym20cMuDCEMvfF2 J7QXSn0sBi+/jNrUJbr+AJHw/KtAtgTA4wk1ge9+z9F+o6ucW19zvif54n2EJ/FudB8u FkaiO/+z1GBKu3L7fgWN1mxQlmXQPvBHY3dMXr+9/7AzdHz/np4rLz2PLrQ61+3oOLPh quWaGZXqM49jhG9chs6zGLgxd1UMF+IS7CyWK5ZfBgERHXqCkZySO8Vpny1NroZr9ez7 76b8/t4cd8ORats73GdnbVu6fCwuYihS5bybn7mTS1/dI1lbUwRcb8OtYpeFKETNmwVm bAIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=XP71DUFxdkq61SHde4FWn2eCeflxbuh0snMVXAMTeJo=; b=pH1KlMzkMrkU4auvp93FvefaoXcg2GsGtIr6/W/mLkgd0bCqHquQwm8hE8hlOyo4JS M9Ae8CtvtPpsORYFP/yT2yxLNks3D/0NBk6kzIVN9mqT3ezsdZQfymf5kEQ4v/Z2qxnF IHjwNMq37ebhTywqtKnAVFsD2D60HaTpyWcjz1MZL6qfnBCN+jO+Y3LFoohjTybag9f9 LWPi0lX7MWWHZj8u+2CI+wiSvsQ5rC3gOkbc7cQtEJSmOMldqE0aGkXMHHyuBokd4+sB ow9xNiw7S0kTaMRge4YxSZDdEG0PjjWWNXzJsE6jX3CLis05SBy9ajkAybAt+w//jqzu 8Bfw== 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 w18si10752094pgf.439.2019.03.13.14.19.32; Wed, 13 Mar 2019 14:19:49 -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 S1727425AbfCMVR3 (ORCPT + 99 others); Wed, 13 Mar 2019 17:17:29 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:37893 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbfCMVR3 (ORCPT ); Wed, 13 Mar 2019 17:17:29 -0400 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPA (Nemesis) id 1MKszj-1hKLaP2FXZ-00LAnW; Wed, 13 Mar 2019 22:17:12 +0100 From: Arnd Bergmann To: Mauro Carvalho Chehab Cc: Arnd Bergmann , Kees Cook , "Gustavo A. R. Silva" , Sean Young , Colin Ian King , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: dib0700: fix link error for dibx000_i2c_set_speed Date: Wed, 13 Mar 2019 22:16:53 +0100 Message-Id: <20190313211709.486583-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:RMZUATCnG99VGNTOjTvIXdQyLvNkz779PJ7UrqeFNzigEIq+XwK Qrc6xpWdDA7wT+UmwrzUKSZRnr2COE43+K9gx88kdhsyao2GaMmqT/2zdkJ2hdADapTs8EJ 7fiIyKVesw08XrNlHPQK9VL/vSLQ8mFRb4+K+0RMvweguTrKO6gZhfWcoHBGucKi89fCQtm kJ7qj6msl9N/5LFnFHEJA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:2JM+skA71oo=:jff/z63rLEksqJkilsE1E4 G/WhGLSSjPQKPI7S6zH8ujmEB/FqRKFp4TGo3U0bNCzmlErRCvYvyzCYgvAjLgWZNPgIaSEoX 8bhKHOXapS2bG8DufigK8+LTE6zahP7L6lwl+fBUoxeR1CluEGWIKdR2E0GcKQLFzv8/b2rO6 JKhE6eVWGsGNaaoTt9osgDGEf1ZDQtr6YkCUkiEudoEyc2JwkX8N9j6Et/RiTyhzPrLpC6bye o0E6hmKgsF/16HOFDDb0mGpbgd7bKhOum2FMnZVF7ZVhB/eePtMLIdNe/hcJ8SsTwYYKqE5m6 5tVExEz4UqUMEIAMm6TCPcOBDBOqttwlNFfgun55TkUBqW3t32IJrUE8UbqflyT9zFdFwL+vb Pg+5ahKGyVXlDIcwtNoAawhfU+ugrH4nVs6t8X+YEeqYD9rCqLX+uJr33M68BPJr7qyun0Mx1 qJj+gJluKR3Keqo7u8ySxHvaAfhBc5ofopA7TniAPYPL3gBmZcmYD0HGCbJ8zRnM+30af6QMR FrhAy1YUmss/rXM07FNQL8KamnOR60QNuppXaTwS1GwXaehWImtSuveLwzIOtY31NU03tGFyB j70fPQ23Co4gGjLCnfuaVpz8FyWbU0d8ye8QdNxS+L2jqVz31i6jDFz8Xheiclf74yGReKpfN poTJGI8u+bwqw6qC8fB38q1DGeNqUvg+8fLC+fsbCr9Qtjg3AVUFW2PprSPmA8OFs4Uk8docP tjGgNXeDN4tkEYcP5jsPa6G8ihKaj75kDxZAKg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_DVB_DIB9000 is disabled, we can still compile code that now fails to link against dibx000_i2c_set_speed: drivers/media/usb/dvb-usb/dib0700_devices.o: In function `dib01x0_pmu_update.constprop.7': dib0700_devices.c:(.text.unlikely+0x1c9c): undefined reference to `dibx000_i2c_set_speed' The call sites are both through dib01x0_pmu_update(), which gets passed an 'i2c' pointer from dib9000_get_i2c_master(), which has returned NULL. Checking this pointer seems to be a good idea anyway, and it avoids the link failure. Fixes: b7f54910ce01 ("V4L/DVB (4647): Added module for DiB0700 based devices") Signed-off-by: Arnd Bergmann --- drivers/media/usb/dvb-usb/dib0700_devices.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/usb/dvb-usb/dib0700_devices.c index 9311f7d4bba5..4cbc64ea17d7 100644 --- a/drivers/media/usb/dvb-usb/dib0700_devices.c +++ b/drivers/media/usb/dvb-usb/dib0700_devices.c @@ -2445,6 +2445,8 @@ static int dib9090_tuner_attach(struct dvb_usb_adapter *adap) if (dvb_attach(dib0090_fw_register, adap->fe_adap[0].fe, i2c, &dib9090_dib0090_config) == NULL) return -ENODEV; i2c = dib9000_get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_1_2, 0); + if (!i2c) + return -ENODEV; if (dib01x0_pmu_update(i2c, data_dib190, 10) != 0) return -ENODEV; dib0700_set_i2c_speed(adap->dev, 1500); @@ -2524,6 +2526,8 @@ static int nim9090md_tuner_attach(struct dvb_usb_adapter *adap) if (dvb_attach(dib0090_fw_register, adap->fe_adap[0].fe, i2c, &nim9090md_dib0090_config[0]) == NULL) return -ENODEV; i2c = dib9000_get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_1_2, 0); + if (!i2c) + return -ENODEV; if (dib01x0_pmu_update(i2c, data_dib190, 10) < 0) return -ENODEV; -- 2.20.0