diff options
author | Jiri Slaby <jslaby@suse.cz> | 2016-07-20 15:45:08 -0700 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2016-11-20 01:01:28 +0000 |
commit | 634adfb0fb379706cb207beb74602c3e8108ccbb (patch) | |
tree | aec77196682ffed0d4b5619eb1b46bdfb001ed59 /arch | |
parent | 88d2d3999cf2fd0f5d2b4d520f322a084a4858d4 (diff) | |
download | linux-stable-634adfb0fb379706cb207beb74602c3e8108ccbb.tar.gz linux-stable-634adfb0fb379706cb207beb74602c3e8108ccbb.tar.bz2 linux-stable-634adfb0fb379706cb207beb74602c3e8108ccbb.zip |
pps: do not crash when failed to register
commit 368301f2fe4b07e5fb71dba3cc566bc59eb6705f upstream.
With this command sequence:
modprobe plip
modprobe pps_parport
rmmod pps_parport
the partport_pps modules causes this crash:
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: parport_detach+0x1d/0x60 [pps_parport]
Oops: 0000 [#1] SMP
...
Call Trace:
parport_unregister_driver+0x65/0xc0 [parport]
SyS_delete_module+0x187/0x210
The sequence that builds up to this is:
1) plip is loaded and takes the parport device for exclusive use:
plip0: Parallel port at 0x378, using IRQ 7.
2) pps_parport then fails to grab the device:
pps_parport: parallel port PPS client
parport0: cannot grant exclusive access for device pps_parport
pps_parport: couldn't register with parport0
3) rmmod of pps_parport is then killed because it tries to access
pardev->name, but pardev (taken from port->cad) is NULL.
So add a check for NULL in the test there too.
Link: http://lkml.kernel.org/r/20160714115245.12651-1-jslaby@suse.cz
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions