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

Commit 9f80024b authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: Fix NULL pointer access if NCM not instantiated"

parents 65f1c70d 75adfefc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1627,7 +1627,8 @@ int ncm_ctrlrequest(struct usb_composite_dev *cdev,
{
	int value = -EOPNOTSUPP;

	if (ctrl->bRequestType == 0x40 && ctrl->bRequest == 0xF0) {
	if (ctrl->bRequestType == 0x40 && ctrl->bRequest == 0xF0
			&& _ncm_setup_desc) {
		_ncm_setup_desc->minor = (uint8_t)(ctrl->wValue >> 8);
		_ncm_setup_desc->major = (uint8_t)(ctrl->wValue & 0xFF);
		schedule_work(&_ncm_setup_desc->work);