Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1244458ybi; Fri, 2 Aug 2019 11:52:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvpDQ23JxhtYtUGugCdQYKcx4HNHF0dhXudcryhZeGfIgSI2c2qfeIQZgc6gxqxLBq9NiT X-Received: by 2002:a17:902:684f:: with SMTP id f15mr133127461pln.332.1564771937083; Fri, 02 Aug 2019 11:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564771937; cv=none; d=google.com; s=arc-20160816; b=vzUTicg0YbOzknkTUbGkiL1+HqGSU9fiE5UoAR90ttZw4jYrHKQYQhFv9Py9y3AjhU snCwprciOiYuy83Fv6JU+7uGeNyFeOWhhokm1LPSjLu/V25bC+/kLGLb5o6EKa1e3par vw9tyVdwl8+Zsn/hBa+Kyxrxtf6pguvLe8vU4dZdlaEDwTXu1eVNxBVH8ZLdk2dAYNjN IPrN2GZfvlTYW9NctX/grd/P1hgtDv5K9Ow6wcd8sp9Wr3t3hcnsPFi3Qk6Uxsy9MVI1 C9ndcaHwTlNDX5n0GCbpB+zbro1xAw7bD2CVF+/oQiZF+NbegSM87nl6RVlwDJ5mSGSn cnDw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9nHJctranEOiPPOcCEMhl20CJyGxGOVr10SpCwiDHus=; b=AkTbGKpq8tTmM6t81PrFxnHEoIkC7NGDIBHqLJOle3J6NTJzbtDCR5ghTZ9P2Bl4q1 yaxjHCuLpDIexA32OiS0PnXGrw8UShr9ahhD5IKRRrySIhxAqm495brq69kuoyh162+Z KA2+/gviBgZyNaLKXYVNA+IawTcluFCPI7c7WjzbsDXjEm0tvJhBg13lJuGNtp9kyJNA IfhLhQFY4zqgXbTUtn4598v2Z52fHEPd4ovmI7mGPtDkX7jv54xrKF04/C//lnG/F9bF G7Ken85Movhv7i3vfjRLifjT6F25aIaZE7rlv9tTlDcf5QXGnCye/lTWlVcL/sxrCHKD jrow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bdTov3dQ; 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 f22si8039473pgk.349.2019.08.02.11.52.01; Fri, 02 Aug 2019 11:52:17 -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; dkim=pass header.i=@kernel.org header.s=default header.b=bdTov3dQ; 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 S2406281AbfHBJxe (ORCPT + 99 others); Fri, 2 Aug 2019 05:53:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:59640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406198AbfHBJx3 (ORCPT ); Fri, 2 Aug 2019 05:53:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DDCEE2086A; Fri, 2 Aug 2019 09:53:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564739608; bh=ZD/d7wEanQe31gJ/K5UdbGiLfybN+idHdUps5k0IfR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bdTov3dQJlhTETZxwZIreIsmzqtDxUlcwZGn1/Tv4phuUbcxOd61TNMxPvjFL64qL OGKwsCNrbhGuWFVTQxeqDSkLzkSxhj0JVteINABOP5SpQx5jwVeA4laBQOP9jxM3yE 5qtRKeNUukQwkHU4jhWlLOLtU5Sn1OZMnhvrAmd0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+357d86bcb4cca1a2f572@syzkaller.appspotmail.com, Sean Young , Mauro Carvalho Chehab Subject: [PATCH 4.9 217/223] media: au0828: fix null dereference in error path Date: Fri, 2 Aug 2019 11:37:22 +0200 Message-Id: <20190802092250.761351262@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092238.692035242@linuxfoundation.org> References: <20190802092238.692035242@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Young commit 6d0d1ff9ff21fbb06b867c13a1d41ce8ddcd8230 upstream. au0828_usb_disconnect() gets the au0828_dev struct via usb_get_intfdata, so it needs to set up for the error paths. Reported-by: syzbot+357d86bcb4cca1a2f572@syzkaller.appspotmail.com Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/usb/au0828/au0828-core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/drivers/media/usb/au0828/au0828-core.c +++ b/drivers/media/usb/au0828/au0828-core.c @@ -630,6 +630,12 @@ static int au0828_usb_probe(struct usb_i /* Setup */ au0828_card_setup(dev); + /* + * Store the pointer to the au0828_dev so it can be accessed in + * au0828_usb_disconnect + */ + usb_set_intfdata(interface, dev); + /* Analog TV */ retval = au0828_analog_register(dev, interface); if (retval) { @@ -647,12 +653,6 @@ static int au0828_usb_probe(struct usb_i /* Remote controller */ au0828_rc_register(dev); - /* - * Store the pointer to the au0828_dev so it can be accessed in - * au0828_usb_disconnect - */ - usb_set_intfdata(interface, dev); - pr_info("Registered device AU0828 [%s]\n", dev->board.name == NULL ? "Unset" : dev->board.name);