Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2863336pxv; Mon, 12 Jul 2021 03:53:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyOnMnlsO7JrrqoOxRUHY8xCR3QuzxnKH+iMab+AxDuI7oHmVj401YcCITtRP3wJuhpuoG X-Received: by 2002:a92:9509:: with SMTP id y9mr37595772ilh.18.1626087210358; Mon, 12 Jul 2021 03:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626087210; cv=none; d=google.com; s=arc-20160816; b=gF7JEd2zDg6GDGMnf6DA73L6tPKTykJYNlEmEUEDGrR8+JIJPXqvjYjNcJ6qxzNwCS WeI/9GZqVwwtQxMzR7TavaU3dEXbP651GTnGHr++nnmxx+E6hVQsvwTNz0oQxcO2lqFq FskfihLSAAVvAIwY86WI8ZMHoKQH2LE9X4HHoF5M1MfB2m39NyjJn4DKeYftF9BNGahd zgilHODmxmnCCDLn5cvGbs/GB5wIf6tddzwYtShSuwtdnuqYOTWYT6sUkyk0hGMwdwXK cKIkhBnjD8FpAqLkfJwk2CAUUYwxsCrEGwiyOtpGQim37vJWd9YcJ3s277ugcCFgher/ DKgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rdU4SUq1ZFQWhmudnNusPudzPZ9Xfi9XV1pvPoXjwAA=; b=ZSqCS2nV8y89ifUOcXbqC0cM/uwrvGhfKX0cPWYn8PNKG6XEuCrhyn2Urv6Aglv5+5 vqxuznrbtCrupPIcEvxge2o9RgFDQfigl168jEqeOSF0aq09PIYLI4hb/dKThYtM6qAE 0O+c8DLHJTYf2zwish7JaDKHaCmiHo6vFcx5kzA80vHZL9wP7z+ztGbLqhZm/7laFKig QFoYjkTHWu8+BCkermmrOKoLsbK40qmehVQyszYDjXj/l9z1/nCvsH46qVsaTAGWlNHo kC7bTUkh1GxgDohAWNZI51LXhWT6xmOKsKcamcXkRmOOZ2LI/C4uPvRwzwqS1tKDxH3a 4gqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ysAKkmww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si21308028jau.121.2021.07.12.03.53.19; Mon, 12 Jul 2021 03:53:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ysAKkmww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351580AbhGLIXD (ORCPT + 99 others); Mon, 12 Jul 2021 04:23:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:43060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347672AbhGLHkA (ORCPT ); Mon, 12 Jul 2021 03:40:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AD515613E0; Mon, 12 Jul 2021 07:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626075323; bh=UP4NVnaV6TahKYzkSvQfpMg9+VdQvMocKGAKxZKRlTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ysAKkmwwEtAan933UFD/EAqQgM6EjKt4VIuHmJAx6qrwrYld9oHCFh/6wyacqL8iJ i4ysfzUvHHDSxNkKsIAdAr2NXbXwPwVzzBdqOSVXJ045VxoavYmcD7jo8ugNSU8vPc aLG9dAFzOOwqZVn0BHG93pPn7athj4A3ID6UrFms= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+e74a998ca8f1df9cc332@syzkaller.appspotmail.com, Anirudh Rayabharam , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.13 154/800] media: pvrusb2: fix warning in pvr2_i2c_core_done Date: Mon, 12 Jul 2021 08:02:57 +0200 Message-Id: <20210712060934.672480201@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060912.995381202@linuxfoundation.org> References: <20210712060912.995381202@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anirudh Rayabharam [ Upstream commit f8194e5e63fdcb349e8da9eef9e574d5b1d687cb ] syzbot has reported the following warning in pvr2_i2c_done: sysfs group 'power' not found for kobject '1-0043' When the device is disconnected (pvr_hdw_disconnect), the i2c adapter is not unregistered along with the USB and v4l2 teardown. As part of the USB device disconnect, the sysfs files of the subdevices are also deleted. So, by the time pvr_i2c_core_done is called by pvr_context_destroy, the sysfs files have been deleted. To fix this, unregister the i2c adapter too in pvr_hdw_disconnect. Make the device deregistration code shared by calling pvr_hdw_disconnect from pvr2_hdw_destroy. Reported-by: syzbot+e74a998ca8f1df9cc332@syzkaller.appspotmail.com Tested-by: syzbot+e74a998ca8f1df9cc332@syzkaller.appspotmail.com Reviewed-by: Greg Kroah-Hartman Signed-off-by: Anirudh Rayabharam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c index f4a727918e35..d38dee1792e4 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c @@ -2676,9 +2676,8 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw) pvr2_stream_destroy(hdw->vid_stream); hdw->vid_stream = NULL; } - pvr2_i2c_core_done(hdw); v4l2_device_unregister(&hdw->v4l2_dev); - pvr2_hdw_remove_usb_stuff(hdw); + pvr2_hdw_disconnect(hdw); mutex_lock(&pvr2_unit_mtx); do { if ((hdw->unit_number >= 0) && @@ -2705,6 +2704,7 @@ void pvr2_hdw_disconnect(struct pvr2_hdw *hdw) { pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_disconnect(hdw=%p)",hdw); LOCK_TAKE(hdw->big_lock); + pvr2_i2c_core_done(hdw); LOCK_TAKE(hdw->ctl_lock); pvr2_hdw_remove_usb_stuff(hdw); LOCK_GIVE(hdw->ctl_lock); -- 2.30.2