The previous code allocated a char buffer of size MCE_CMDBUF_SIZE (384) by kzalloc():ing sizeof(unsigned) * MCE_CMDBUF_SIZE bytes. The buffer was therefore 4 * the necessary size. Additionally, zeroing out the buffer is pointless. Replace the allocated buffer with a stack buffer. Signed-off-by: David Härdeman <david@xxxxxxxxxxx> --- drivers/media/rc/mceusb.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index f0f053d..9f546be 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -785,11 +785,7 @@ static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count) struct mceusb_dev *ir = dev->priv; int i, ret = 0; int cmdcount = 0; - unsigned char *cmdbuf; /* MCE command buffer */ - - cmdbuf = kzalloc(sizeof(unsigned) * MCE_CMDBUF_SIZE, GFP_KERNEL); - if (!cmdbuf) - return -ENOMEM; + unsigned char cmdbuf[MCE_CMDBUF_SIZE]; /* MCE command buffer */ /* MCE tx init header */ cmdbuf[cmdcount++] = MCE_CMD_PORT_IR; @@ -841,7 +837,6 @@ static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count) mce_async_out(ir, cmdbuf, cmdcount); out: - kfree(cmdbuf); return ret ? ret : count; } -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html