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

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

Merge "usb: gadget: Validate the port number in grmnet_ctrl_smd_port_alloc"

parents 17e86c9c 30dadc31
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -592,6 +592,11 @@ static int grmnet_ctrl_smd_port_alloc(int portno)
	struct smd_ch_info	*c;
	struct platform_driver	*pdrv;

	if (portno >= MAX_CTRL_PORT) {
		pr_err("Illegal port number.\n");
		return -EINVAL;
	}

	port = kzalloc(sizeof(struct rmnet_ctrl_port), GFP_KERNEL);
	if (!port)
		return -ENOMEM;