Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: wm831x-ts - convert to devm_kzalloc()

Saves a little code and eliminates the possibility of introducing some
leaks.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Mark Brown and committed by
Dmitry Torokhov
ef8dee5c 2f7badb9

+2 -3
+2 -3
drivers/input/touchscreen/wm831x-ts.c
··· 245 245 if (core_pdata) 246 246 pdata = core_pdata->touch; 247 247 248 - wm831x_ts = kzalloc(sizeof(struct wm831x_ts), GFP_KERNEL); 248 + wm831x_ts = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ts), 249 + GFP_KERNEL); 249 250 input_dev = input_allocate_device(); 250 251 if (!wm831x_ts || !input_dev) { 251 252 error = -ENOMEM; ··· 377 376 free_irq(wm831x_ts->data_irq, wm831x_ts); 378 377 err_alloc: 379 378 input_free_device(input_dev); 380 - kfree(wm831x_ts); 381 379 382 380 return error; 383 381 } ··· 388 388 free_irq(wm831x_ts->pd_irq, wm831x_ts); 389 389 free_irq(wm831x_ts->data_irq, wm831x_ts); 390 390 input_unregister_device(wm831x_ts->input_dev); 391 - kfree(wm831x_ts); 392 391 393 392 return 0; 394 393 }