summaryrefslogtreecommitdiff
path: root/include/linux/console_struct.h
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2013-11-08 15:03:42 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-11 16:16:45 -0800
commit63ab039511509739f881acfb99aef76b772e35a2 (patch)
tree0405ce8c45c3c7c3feabd050f0f6e250e772e8e5 /include/linux/console_struct.h
parent49445b9117a6e9ca9a741251784432a1da2f9919 (diff)
staging: comedi: make determination of read or write subdevice safer
`comedi_read_subdevice()` and `comedi_write_subdevice()` respectively determine the read and write subdevice to use for a comedi device, depending on a minor device number passed in. The comedi device has a main "board" minor device number and may also have dynamically assigned, subdevice-specific minor device numbers, in a range of numbers shared by all comedi devices. If the minor device number is within the range of subdevice-specific minor device numbers, both functions call `comedi_subdevice_from_minor()` to determine what subdevice is associated with the minor device number (if any) and then check the subdevice belongs to the comedi device. Since the subdevice might belong to a different comedi device, the check is not protected against the subdevice being freed. Perform the check in `comedi_subdevice_from_minor()` instead, where it is protected against the subdevice being freed. Make it return `NULL` if the subdevice does not belong to the device. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/console_struct.h')
0 files changed, 0 insertions, 0 deletions