diff options
author | Andrej Krutak <dev@andree.sk> | 2016-08-18 23:52:12 +0200 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2016-08-31 19:21:09 -0400 |
commit | bdd62ec6d873be9e3bcdc34d2deb45a541873650 (patch) | |
tree | 55431f45baf307f787021a8a56e773e37ee75da4 /sound | |
parent | 571d36168dc246837e96ce40a7e535f1b70622e6 (diff) | |
download | linux-exynos-bdd62ec6d873be9e3bcdc34d2deb45a541873650.tar.gz linux-exynos-bdd62ec6d873be9e3bcdc34d2deb45a541873650.tar.bz2 linux-exynos-bdd62ec6d873be9e3bcdc34d2deb45a541873650.zip |
ALSA: line6: Fix POD sysfs attributes segfault
[ Upstream commit b027d11263836a0cd335520175257dcb99b43757 ]
The commit 02fc76f6a changed base of the sysfs attributes from device to card.
The "show" callbacks dereferenced wrong objects because of this.
Fixes: 02fc76f6a7db ('ALSA: line6: Create sysfs via snd_card_add_dev_attr()')
Cc: <stable@vger.kernel.org> # v4.0+
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Andrej Krutak <dev@andree.sk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/line6/pod.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/usb/line6/pod.c b/sound/usb/line6/pod.c index daf81d169a42..45dd34874f43 100644 --- a/sound/usb/line6/pod.c +++ b/sound/usb/line6/pod.c @@ -244,8 +244,8 @@ static int pod_set_system_param_int(struct usb_line6_pod *pod, int value, static ssize_t serial_number_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); + struct snd_card *card = dev_to_snd_card(dev); + struct usb_line6_pod *pod = card->private_data; return sprintf(buf, "%u\n", pod->serial_number); } @@ -256,8 +256,8 @@ static ssize_t serial_number_show(struct device *dev, static ssize_t firmware_version_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); + struct snd_card *card = dev_to_snd_card(dev); + struct usb_line6_pod *pod = card->private_data; return sprintf(buf, "%d.%02d\n", pod->firmware_version / 100, pod->firmware_version % 100); @@ -269,8 +269,8 @@ static ssize_t firmware_version_show(struct device *dev, static ssize_t device_id_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); + struct snd_card *card = dev_to_snd_card(dev); + struct usb_line6_pod *pod = card->private_data; return sprintf(buf, "%d\n", pod->device_id); } |