Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4379225yba; Sun, 19 May 2019 18:01:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUWlJddciwCiMCKIqHAxi7qKq7+vfWGBJSieOA7cl+tjWP7GimYXFxvDjjqNxmQ6CyzW32 X-Received: by 2002:aa7:8683:: with SMTP id d3mr31816915pfo.145.1558314087237; Sun, 19 May 2019 18:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558314087; cv=none; d=google.com; s=arc-20160816; b=ZPAyerncKalsypHG8ZUqEXXO9La5GrZW6Qiu1QwqBwAdDqytZ9B2xZqilRRIlO89E2 lhFHfdBzwAb83s5gZVWrLpo+096X2ER0z84D7s0/OuylXesxz7Rp6rbe7scXv2/3wWKp Z7THAA0Youzz1Hq9A5YNRUMFJieWwk99ogjA8CqnTNrJWbFMor2MdbizlZY3BjlsrNfB m5BAFQqspeF1NNdHRYcaVgiVkDMCVnPWs+ZK5JcsSklya6aDDJJJ9VwW0Sen/cxJeonh nhUKRTT6XROqOJftbO64QiYZ5oPlRFD5WvFona7Y430VfU27OrtxjYpLTrT9wQpJ/rzY CYVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NkDe83VgW00T/SGNAnF0R9A1EmY3Q3lfW+lUsvA4F48=; b=dmpM1jijc7MsX+PRKEwOzkjVbG18CJok4sGcfnMfDw4Lo5vHzbmcFEW1wT5pAITiEL u2AKmCdF7G8i63mneJxJL+AKvo5RNMNZYCmIRkCmREnmFEo4VdczXPwE7xA9E09bMNfW 8F5g4nc680G59qoiRW+bs3dybbkU3eeLvD8lQgyfx7H5HIfBkEoIk1ur8f5u28jar8/e ZEVlL5eEt9W3Wa+Jx4TPQ6Dk9662Sv8kw6y0C+UJmriiSKLQNh81abu/ylIKUfkQAsTg WiGjepF9Zb/UBH+awH4JAJzQR1ES+Upt964B2GVbTfT8XO2RO1X4mdGYmBZfXnnd7ESX QBvw== 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 x32si13497912pld.125.2019.05.19.18.01.12; Sun, 19 May 2019 18:01:27 -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 S1730067AbfESTtB (ORCPT + 99 others); Sun, 19 May 2019 15:49:01 -0400 Received: from gofer.mess.org ([88.97.38.141]:44355 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728287AbfESTtB (ORCPT ); Sun, 19 May 2019 15:49:01 -0400 Received: by gofer.mess.org (Postfix, from userid 1000) id 7519460E1A; Sun, 19 May 2019 20:48:58 +0100 (BST) Date: Sun, 19 May 2019 20:48:58 +0100 From: Sean Young To: syzbot Cc: andreyknvl@google.com, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-usb@vger.kernel.org, mchehab@kernel.org, syzkaller-bugs@googlegroups.com Subject: [PATCH] media: au0828: fix null dereference in error path Message-ID: <20190519194858.2bojwep7monfytk2@gofer.mess.org> References: <000000000000faf6000588ef7a11@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000000000000faf6000588ef7a11@google.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/media/usb/au0828/au0828-core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c index 925a80437822..e306d5d5bebb 100644 --- a/drivers/media/usb/au0828/au0828-core.c +++ b/drivers/media/usb/au0828/au0828-core.c @@ -729,6 +729,12 @@ static int au0828_usb_probe(struct usb_interface *interface, /* 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) { @@ -747,12 +753,6 @@ static int au0828_usb_probe(struct usb_interface *interface, /* 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); -- 2.20.1