From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Douglas Bagnall <douglas@paradise.net.nz>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] Avoid sysfs oops when an rc_dev's raw device is absent
Date: Thu, 05 Jul 2012 23:29:37 -0300 [thread overview]
Message-ID: <4FF64D91.1090001@redhat.com> (raw)
In-Reply-To: <4FE7C27B.8060207@paradise.net.nz>
Em 24-06-2012 22:44, Douglas Bagnall escreveu:
> hi,
>
> I probably should have sent that in reply to
> http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/49740
> which is the problem it fixes.
>
> Some things which might be of interest:
>
> 1. I innocently followed the instructions on
> http://www.linuxtv.org/wiki/index.php/Maintaining_Git_trees (i.e.,
> use v4l-dvb tree on top of linus tree) and spent a while looking at
> IR/ir-sysfs.c instead of rc/rc-main.c. How stable it seemed! no
> patches in years! So I added a warning at the top of the wiki page,
> though a fix from someone who knows would be preferable.
Please help us updating the wiki pages. Unfortunately, almost all developers
have no time to update wiki pages, and expect community help on that.
>
> 2. From the above, I ended up reading a lot of ancient history and saw
> that this was inadvertently sort of fixed for a few weeks in 2010
> between a08c7c68f702e2a2797a4035b and d8b4b5822f51e2142b731b42.
>
> 3. I wrote:
>
>> This patch avoids the NULL dereference, and ignores the issue of how
>> this state of affairs came about in the first place.
>
> Would, in rc_unregister_device(), putting device_del(&dev->dev) before
> ir_raw_event_unregister(dev) help? I've only been a kernel hacker for
> two hours so I am honestly clueless, but it seems like that might
> avert the race by hiding the structure from sysfs before it is pulled
> apart.
Reverting the order might help on your specific case, but device_del()
does more than just removing the driver: it also can free some used
structures, with might lead into an OOPS, if the driver is polling for
IR.
So, your patch is likely less risky to cause side effects.
Regards,
Mauro
next prev parent reply other threads:[~2012-07-06 2:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-25 0:00 [PATCH] Avoid sysfs oops when an rc_dev's raw device is absent Douglas Bagnall
2012-06-25 1:44 ` Douglas Bagnall
2012-07-06 2:29 ` Mauro Carvalho Chehab [this message]
2012-07-06 2:24 ` Mauro Carvalho Chehab
2012-07-07 3:27 ` [PATCH v2] " Douglas Bagnall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FF64D91.1090001@redhat.com \
--to=mchehab@redhat.com \
--cc=douglas@paradise.net.nz \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).