History

[media] staging/lirc: fix mem leaks and ptr err usage

When the lirc drivers were converted over to using memdup_user, I mistakenly also removed corresponding calls to kfree. Add those back. I also screwed up on the allocation error check in lirc_serial, using if (PTR_ERR()) instead of if (IS_ERR()), which broke transmit.

Jarod Wilson committed 15 years ago

Commit 88914bd1 parent 559d1626 files · +20 −6Browse files

Showing the changes to drivers/staging/lirc/lirc_sir.c (1 of 6 files). Show all

Unified · Split

drivers/staging/lirc/lirc_sir.c+1−0
@@ -330,6 +330,7 @@ static ssize_t lirc_write(struct file *file, const char *buf, size_t n, · 329 unmodified lines
330330 /* enable receiver */
331331 Ser2UTCR3 = UTCR3_RXE|UTCR3_RIE;
332332 #endif
333+ kfree(tx_buf);
333334 return count;
334335 }
335336