Skip to contentSkip to conversation

Patch "ALSA: line6: Fix POD sysfs attributes segfault" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Sep 5, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ALSA: line6: Fix POD sysfs attributes segfault

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
alsa-line6-fix-pod-sysfs-attributes-segfault.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From b027d11263836a0cd335520175257dcb99b43757 Mon Sep 17 00:00:00 2001

From: Andrej Krutak <[email protected]>
Date: Thu, 18 Aug 2016 23:52:12 +0200
Subject: ALSA: line6: Fix POD sysfs attributes segfault

From: Andrej Krutak <[email protected]>

commit b027d11263836a0cd335520175257dcb99b43757 upstream.

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()')
---
 sound/usb/line6/pod.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
sound/usb/line6/pod.c +6 -6
@@ -244,8 +244,8 @@ static int pod_set_system_param_int(stru
 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
 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(str
 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);
 }

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/alsa-line6-give-up-on-the-lock-while-urbs-are-released.patch queue-4.4/alsa-line6-remove-double-line6_pcm_release-after-failed-acquire.patch queue-4.4/alsa-line6-fix-pod-sysfs-attributes-segfault.patch