Received: by 10.223.185.116 with SMTP id b49csp411013wrg; Fri, 16 Feb 2018 00:49:20 -0800 (PST) X-Google-Smtp-Source: AH8x225h/fFiRAUAdNNudKY6nhZ4o/J/9DhYhN9/4yLU7/njyhe+AGAs3wudAIakL1j+W+880n5p X-Received: by 2002:a17:902:48c8:: with SMTP id u8-v6mr5098411plh.272.1518770960833; Fri, 16 Feb 2018 00:49:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518770960; cv=none; d=google.com; s=arc-20160816; b=G9OgLdE6mO8C6VreUK4s9DZFMZr7P4P8p53fZtncd3JTdMwBs9NyAIh+jSQHUwMy6W CrynCqmF9unhMB+VKf4QM1UAIo8zZKMeeuOr/0HuhdPDyfoDQ7c8Hs31ZpnUz4U1kPQ5 jiUCCAiv2AAILWyFnQF8vJxbc7Gd7aIBFplemd3nKVYiaO2zkURmOC3yzr8eDnfaohyL /d9igVCKgSCl3X4UH8Wcal+s5n+fXsJyPja9H749f+SSMovCF4GgMepF/iYySTB5oZkg NqWPabRrdUfuH4WQDC1DRH0pxwz0tC9gHQIMKD74Lwe0iiaVRjJAKe9mB0iFAqHNdW3+ ERLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=alHq6o2bwE4Y9QFzjd4yL/n+9g1VEyvJjccijbgIuIQ=; b=K8RCuHEiAQ4RjyRIpvXcXiLnHzgcEtNJCYE6C2sy0pLm4ektKgS82SDFWuw9TrKw67 Sq07PT2JERkdSq9lKe4Z7yEINaSEhfaHtCyEM7EL4LSWeKOWkizxLgcCr/NLKHk/8O9A Hk2AQOMp+o399jrjpeRtHH/edj5FfDdDI+Wy0O+Mp3oSX1B+TH1QKb4TyrkX+pOeQ14m PqrKyg6xyALMLdkLOTYWtOpI9diI5vnzhNpv74bQadTxT1CPWf/JqAS8yyvWIHRMr1bx dYdMsctri9Thq6k437Gku3uoKX7Rhl1pWnKXv3/OlJpUdPqth+eRWmpGBpgxUu9wQ3vc GjEA== 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 s1si3597491pgb.64.2018.02.16.00.49.06; Fri, 16 Feb 2018 00:49:20 -0800 (PST) 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 S1426463AbeBOQsE (ORCPT + 99 others); Thu, 15 Feb 2018 11:48:04 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:60222 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423789AbeBOPkr (ORCPT ); Thu, 15 Feb 2018 10:40:47 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E054F1169; Thu, 15 Feb 2018 15:40:46 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrey Konovalov , Malcolm Priestley , Mauro Carvalho Chehab , Ben Hutchings Subject: [PATCH 4.15 013/202] media: dvb-usb-v2: lmedm04: move ts2020 attach to dm04_lme2510_tuner Date: Thu, 15 Feb 2018 16:15:13 +0100 Message-Id: <20180215151713.521839138@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Malcolm Priestley commit 7bf7a7116ed313c601307f7e585419369926ab05 upstream. When the tuner was split from m88rs2000 the attach function is in wrong place. Move to dm04_lme2510_tuner to trap errors on failure and removing a call to lme_coldreset. Prevents driver starting up without any tuner connected. Fixes to trap for ts2020 fail. LME2510(C): FE Found M88RS2000 ts2020: probe of 0-0060 failed with error -11 ... LME2510(C): TUN Found RS2000 tuner kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN Reported-by: Andrey Konovalov Signed-off-by: Malcolm Priestley Tested-by: Andrey Konovalov Signed-off-by: Mauro Carvalho Chehab Cc: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- drivers/media/usb/dvb-usb-v2/lmedm04.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) --- a/drivers/media/usb/dvb-usb-v2/lmedm04.c +++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c @@ -1076,8 +1076,6 @@ static int dm04_lme2510_frontend_attach( if (adap->fe[0]) { info("FE Found M88RS2000"); - dvb_attach(ts2020_attach, adap->fe[0], &ts2020_config, - &d->i2c_adap); st->i2c_tuner_gate_w = 5; st->i2c_tuner_gate_r = 5; st->i2c_tuner_addr = 0x60; @@ -1143,17 +1141,18 @@ static int dm04_lme2510_tuner(struct dvb ret = st->tuner_config; break; case TUNER_RS2000: - ret = st->tuner_config; + if (dvb_attach(ts2020_attach, adap->fe[0], + &ts2020_config, &d->i2c_adap)) + ret = st->tuner_config; break; default: break; } - if (ret) + if (ret) { info("TUN Found %s tuner", tun_msg[ret]); - else { - info("TUN No tuner found --- resetting device"); - lme_coldreset(d); + } else { + info("TUN No tuner found"); return -ENODEV; }