In other than the FTM modes the memory allocated for the ftm
object is not used. Optimize the memory allocations by checking
for the device mode before allocating.
Change-Id: I5e8e454ae43b480e9d55cadb89c0757a1267b029
CRs-Fixed: 2809963
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within ftm replace any such comparisons with logical
operations performed on the pointer itself.
Change-Id: I0b089f46e99ab72a9ae494267a32e8b342a08ae3
CRs-Fixed: 2418259