msm: rpc: invalidate data structures during close
msm: rpc: invalidate data structures during close

When device powers down, RPC Router close can get called from both the
reboot notifier and from the platform driver remove resulting in an
access-after-free bug.

Invalidate internal data structures and check for NULL to gracefully
handle multiple close operations.

CRs-Fixed: 394129
Change-Id: I9d16afdef4962e48e2d45e9523441744b6611b00
Signed-off-by: Arun Kumar Neelakantam <e36519ed998e577ca4306dc3c35b89f0bef834f3@codeaurora.org>
Signed-off-by: Eric Holmberg <5000aa55685d659e1f7f26ece526f9c7021ab484@codeaurora.org>

TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas