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

Commit a8c779eb authored by Markus Elfring's avatar Markus Elfring Committed by Mauro Carvalho Chehab
Browse files

[media] imon: Improve a size determination in two functions



Replace the specification of data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent d7a6795b
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -602,8 +602,7 @@ static int send_packet(struct imon_context *ictx)
		ictx->tx_urb->actual_length = 0;
	} else {
		/* fill request into kmalloc'ed space: */
		control_req = kmalloc(sizeof(struct usb_ctrlrequest),
				      GFP_KERNEL);
		control_req = kmalloc(sizeof(*control_req), GFP_KERNEL);
		if (control_req == NULL)
			return -ENOMEM;

@@ -2310,7 +2309,7 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf,
	struct usb_host_interface *iface_desc;
	int ret = -ENOMEM;

	ictx = kzalloc(sizeof(struct imon_context), GFP_KERNEL);
	ictx = kzalloc(sizeof(*ictx), GFP_KERNEL);
	if (!ictx)
		goto exit;