Bug 16473 (mantis-oops) - mantis driver: Oops: BUG: unable to handle kernel NULL pointer dereference
Summary: mantis driver: Oops: BUG: unable to handle kernel NULL pointer dereference
Status: RESOLVED CODE_FIX
Alias: mantis-oops
Product: v4l-dvb
Classification: Unclassified
Component: dvb-other (show other bugs)
Hardware: All Linux
: P1 high
Assignee: Alan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-27 19:21 UTC by Ronny
Modified: 2012-10-23 18:31 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.34.1
Subsystem:
Regression: No
Bisected commit-id:


Attachments
complete trace log (3.55 KB, text/plain)
2010-07-27 19:21 UTC, Ronny
Details
check for null pointer before calling dvb_unregister_frontend or dvb_frontend_detach (829 bytes, patch)
2010-07-27 19:26 UTC, Ronny
Details | Diff

Description Ronny 2010-07-27 19:21:24 UTC
Created attachment 27275 [details]
complete trace log

I tried to load the mantis module but I guess had some required frontend modules disabled. The mantis module could not be loaded and it failed with a null pointer exception.

Jun 30 21:33:24 [kernel] BUG: unable to handle kernel NULL pointer dereference at 0000000000000308
Jun 30 21:33:24 [kernel] IP: [<ffffffff81447ccf>] dvb_unregister_frontend+0xf/0x100
Jun 30 21:33:24 [kernel] PGD 22d13b067 PUD 22c938067 PMD 0
Comment 1 Ronny 2010-07-27 19:26:15 UTC
Created attachment 27276 [details]
check for null pointer before calling dvb_unregister_frontend or dvb_frontend_detach

well, a quick patch

IMHO, it would be much better if dvb_frontend_detach, dvb_unregister_frontend and so forth perform a NULL-check instead of blindly accessing a class member.
Comment 2 Christian Ruppert 2010-10-21 15:00:34 UTC
I can reproduce it here with 2.6.{34,35,36}.

CONFIG_MEDIA_SUPPORT=y
CONFIG_VIDEO_DEV=y
CONFIG_DVB_CORE=y
CONFIG_MEDIA_ATTACH=y

CONFIG_MANTIS_CORE=m
CONFIG_DVB_MANTIS=m
CONFIG_DVB_FE_CUSTOMISE=y
CONFIG_DVB_TDA10023=m
and CONFIG_DVB_PLL=y (Auto selected)

modprobe mantis and it will fail.
It doesn't fail if CONFIG_DVB_TDA10023=y.
Comment 3 Florian Mickler 2012-10-15 21:19:59 UTC
A patch referencing this bug report has been merged in Linux v3.7-rc1:

commit e1d45ae10aea8e8a403e5d96bf5902ee670007ff
Author: Alan Cox <alan@linux.intel.com>
Date:   Thu Aug 9 12:33:52 2012 -0300

    [media] mantis: fix silly crash case

Note You need to log in before you can comment on or make changes to this bug.