PATCH: drivers/staging/lirc/lirc_serial.c: use IS_ERR()

From: Mark Lord
Date: Sun Feb 06 2011 - 15:39:37 EST


The lirc_serial.c module has never worked with ordinary homebrew
serial blaster hardware, and leaks memory when this is attempted.

Fix it by replacing incorrect usage of PTR_ERR() with IS_ERR().
(patch is inline and also attached to bypass mailer issues).

Signed-off-by: Mark Lord <mlord@xxxxxxxxx>

--- linux-2.6.37/drivers/staging/lirc/lirc_serial.c 2011-01-04
19:50:19.000000000 -0500
+++ linux/drivers/staging/lirc/lirc_serial.c 2011-02-06 15:33:49.854453928 -0500
@@ -966,7 +966,7 @@
if (n % sizeof(int) || count % 2 == 0)
return -EINVAL;
wbuf = memdup_user(buf, n);
- if (PTR_ERR(wbuf))
+ if (IS_ERR(wbuf))
return PTR_ERR(wbuf);
spin_lock_irqsave(&hardware[type].lock, flags);
if (type == LIRC_IRDEO) {
--- linux-2.6.37/drivers/staging/lirc/lirc_serial.c.orig 2011-01-04 19:50:19.000000000 -0500
+++ linux/drivers/staging/lirc/lirc_serial.c 2011-02-06 15:33:49.854453928 -0500
@@ -966,7 +966,7 @@
if (n % sizeof(int) || count % 2 == 0)
return -EINVAL;
wbuf = memdup_user(buf, n);
- if (PTR_ERR(wbuf))
+ if (IS_ERR(wbuf))
return PTR_ERR(wbuf);
spin_lock_irqsave(&hardware[type].lock, flags);
if (type == LIRC_IRDEO) {