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

Commit 618b7975 authored by Pratham Pratap's avatar Pratham Pratap
Browse files

USB: gadget: qti: Fix NULL check for usb_pid_string



Currently driver is checking for the usb_pid_string to be
NULL but usb_pid_string will never be NULL since it is a
pointer to a static character array. Fix this by checking
the data rather than the pointer which usb_pid_string is
pointing to.

Change-Id: Ifb3aa7b905201dee7b1c0eb6d4ba902ddcccb135
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent 2e88452c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -497,7 +497,7 @@ static int qti_gadget_get_properties(struct qti_usb_gadget *gadget)
		gadget->cdev.desc.bDeviceProtocol = (u8)val;

	/* Check if pid passed via cmdline which takes precedence */
	if (usb_pid_string != NULL) {
	if (usb_pid_string[0] != 0) {
		ret = kstrtoint(usb_pid_string, 16, &val);
		if (ret)
			return ret;