[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250107015143.655306-1-make24@iscas.ac.cn>
Date: Tue, 7 Jan 2025 09:51:43 +0800
From: Ma Ke <make24@...as.ac.cn>
To: sean@...s.org
Cc: linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org,
make24@...as.ac.cn,
mchehab@...nel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] media: lirc: Fix error handling in lirc_register()
Sean Young<sean@...s.org> wrote:
> Hi,
>
> On Sun, Jan 05, 2025 at 06:01:01PM +0800, Ma Ke wrote:
> > When cdev_device_add() failed, calling put_device() to explicitly
> > release dev->lirc_dev. Otherwise, it could cause the fault of the
> > reference count.
> >
> > Found by code review.
>
> Interesting find, thanks for finding and reporting.
>
> So I think the idea is right, but there is a problem. lirc_release_device()
> will do a put_device() on the rcdev, but no corresponding get_device() is
> done in this code path.
>
>
> Sean
Thank you for your reply and suggestions. Following your instructions,
I took a close look at the code. Perhaps you meant to suggest removing
the put_device() call from lirc_release_device(), effectively making
lirc_release_device() an empty function?
Looking forward to your reply.
--
Regards,
Ma Ke
Powered by blists - more mailing lists