Commit c817e6cc authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Kees Cook
Browse files

Convert v4l2 event to struct_size

parent 7654cb1b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -215,8 +215,7 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,
	if (elems < 1)
		elems = 1;

	sev = kvzalloc(sizeof(*sev) + sizeof(struct v4l2_kevent) * elems,
		       GFP_KERNEL);
	sev = kvzalloc(struct_size(sev, events, elems), GFP_KERNEL);
	if (!sev)
		return -ENOMEM;
	for (i = 0; i < elems; i++)