From: Vaibhav Hiremath Date: Wed, 15 Jun 2016 04:53:23 +0000 (+0530) Subject: greybus: svc: Pass the correct pointer to input_free_device() X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~244 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=880bc0a4afa66e36f62e5687bef464a751781d55;p=karo-tx-linux.git greybus: svc: Pass the correct pointer to input_free_device() In gb_svc_input_create() fn, on failure, wrong pointer was being passed to input_free_device(). Correct it. svc->input gets initialized only on successful return of this fn, so it is absolutely wrong to pass svc->input to input_free_device(). Testing Done: Tested on EVT2.0 platform. Signed-off-by: Vaibhav Hiremath Reviewed-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c index e316f08ab756..48d07a91f01f 100644 --- a/drivers/staging/greybus/svc.c +++ b/drivers/staging/greybus/svc.c @@ -1352,7 +1352,7 @@ static struct input_dev *gb_svc_input_create(struct gb_svc *svc) return input_dev; err_free_input: - input_free_device(svc->input); + input_free_device(input_dev); return ERR_PTR(-ENOMEM); }