From: Dan Carpenter Date: Wed, 04 Apr 2012 11:19:38 +0000 Subject: [patch] Input: wacom: NULL dereference on allocation failure Message-Id: <20120404111938.GB23719@elgon.mountain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dmitry Torokhov Cc: Tatsunosuke Tobita , linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org If the "wac_i2c" alloction fails, then it leads to a NULL dereference. Signed-off-by: Dan Carpenter diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index b29f064..b8ca4a6 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -252,7 +252,7 @@ static int __devinit wacom_i2c_probe(struct i2c_client *client, err_free_irq: free_irq(client->irq, wac_i2c); err_free_mem: - input_free_device(wac_i2c->input); + input_free_device(input); kfree(wac_i2c); return error;