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

Commit 32002f72 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab
Browse files

[media] lirc: cannot read from tx-only device



Bail out early, otherwise we follow a null pointer.

Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 7a6628b5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -647,6 +647,9 @@ ssize_t lirc_dev_fop_read(struct file *file,
		return -ENODEV;
	}

	if (!LIRC_CAN_REC(ir->d.features))
		return -EINVAL;

	dev_dbg(ir->d.dev, LOGHEAD "read called\n", ir->d.name, ir->d.minor);

	buf = kzalloc(ir->chunk_size, GFP_KERNEL);