input: ft5x06_ts: add NULL pointer check

Add null pointer exception check for pointers which
may be NULL after memory allocation failure and may
be deferenced.

This patch is propagated from msm-3.18 kernel.
 'commit 5c6aa1bb97a3 ("input: ft5x06_ts: add NULL
pointer check")'

Change-Id: Ied34d548bff27f8f6da9f4c81896e4505cdce218
Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@codeaurora.org>
Signed-off-by: Sudhakar Manapati <smanap@codeaurora.org>
This commit is contained in:
Sudhakar Manapati 2014-09-03 17:49:52 +05:30 committed by Abinaya P
parent 0d7758f93a
commit 49aaf48f47

View file

@ -1672,7 +1672,7 @@ static int ft5x06_ts_probe(struct i2c_client *client,
data->tch_data_len = FT_TCH_LEN(pdata->num_max_touches);
data->tch_data = devm_kzalloc(&client->dev,
data->tch_data_len, GFP_KERNEL);
if (!data)
if (!data->tch_data)
return -ENOMEM;
input_dev = input_allocate_device();