input: synaptics_i2c_rmi4: Add check to avoid memory leak

Add conditions to check if fhandler already exists in the list
or not. If exists, then free the memory allocated to the new
fhandler. Otherwise add the fhandler to the list.
Change the location of INIT_LIST_HEAD() call to avoid
memory leak.

CRs-fixed: 575094
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Change-Id: Iaf1429b911baffa53f968c0ca986fec190100ded
1 file changed