/* */ #ifndef __HDAC_LOCAL_H #define __HDAC_LOCAL_H int hdac_read_parm(struct hdac_device *codec, hda_nid_t nid, int parm); #define get_wcaps(codec, nid) \ hdac_read_parm(codec, nid, AC_PAR_AUDIO_WIDGET_CAP) /* get the widget type from widget capability bits */ static inline int get_wcaps_type(unsigned int wcaps) { if (!wcaps) return -1; /* invalid type */ return (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; } #define get_pin_caps(codec, nid) \ hdac_read_parm(codec, nid, AC_PAR_PIN_CAP) static inline unsigned int get_pin_cfg(struct hdac_device *codec, hda_nid_t nid) { unsigned int val; if (snd_hdac_read(codec, nid, AC_VERB_GET_CONFIG_DEFAULT, 0, &val)) return -1; return val; } #define get_amp_caps(codec, nid, dir) \ hdac_read_parm(codec, nid, (dir) == HDA_OUTPUT ? \ AC_PAR_AMP_OUT_CAP : AC_PAR_AMP_IN_CAP) #define get_power_caps(codec, nid) \ hdac_read_parm(codec, nid, AC_PAR_POWER_STATE) #endif /* __HDAC_LOCAL_H */ .form.submit();'> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2016-07-20 15:45:08 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-23 10:25:54 +0900
commit368301f2fe4b07e5fb71dba3cc566bc59eb6705f (patch)
tree570a9b7bc5583381d4414500ce615c9f17ce03f4
parent2d6a4d64812bb12dda53704943b61a7496d02098 (diff)
pps: do not crash when failed to register
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> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat