Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c56daad authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "gadget: composite: Fix crash seen when SS descriptor is not available"

parents 07c188dd dd37bd3b
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ static const char longname[] = "Gadget Android";
/* f_midi configuration */
#define MIDI_INPUT_PORTS    1
#define MIDI_OUTPUT_PORTS   1
#define MIDI_BUFFER_SIZE    256
#define MIDI_BUFFER_SIZE    1024
#define MIDI_QUEUE_LENGTH   32

struct android_usb_function {
@@ -2724,7 +2724,8 @@ static ssize_t audio_source_pcm_show(struct device *dev,
	struct audio_source_config *config = f->config;

	/* print PCM card and device numbers */
	return sprintf(buf, "%d %d\n", config->card, config->device);
	return snprintf(buf, PAGE_SIZE,
			"%d %d\n", config->card, config->device);
}

static DEVICE_ATTR(pcm, S_IRUGO, audio_source_pcm_show, NULL);
+6 −0
Original line number Diff line number Diff line
@@ -775,6 +775,12 @@ static int set_config(struct usb_composite_dev *cdev,
		 */
		switch (gadget->speed) {
		case USB_SPEED_SUPER:
			if (!f->ss_descriptors) {
				pr_err("%s(): No SS desc for function:%s\n",
							__func__, f->name);
				usb_gadget_set_state(gadget, USB_STATE_ADDRESS);
				return -EINVAL;
			}
			descriptors = f->ss_descriptors;
			break;
		case USB_SPEED_HIGH:
+1 −1

File changed.

Contains only whitespace changes.