Skip to contentSkip to conversation

Input: CMA3000 - signedness bug in cma3000_thread_irq()

PATCH New Dan Carpenter 1 participant 1 message Oct 13, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: CMA3000 - signedness bug in cma3000_thread_irq()

The ->read() function returns an int; negative error codes on error or a byte of data on success. intr_status needs to be signed here for the error handling to work.

drivers/input/misc/cma3000_d0x.c +2 -1
index 80793f1..2a42b53 100644
@@ -116,7 +116,8 @@ static irqreturn_t cma3000_thread_irq(int irq, void *dev_id)
 {
 	struct cma3000_accl_data *data = dev_id;
 	int datax, datay, dataz;
-	u8 ctrl, mode, range, intr_status;
+	u8 ctrl, mode, range;
+	int intr_status;
 
 	intr_status = CMA3000_READ(data, CMA3000_INTSTATUS, "interrupt status");
 	if (intr_status < 0)