platform: msm_shared: Prevent NULL dereference in G-Link

In glink_close(), it is possible for a NULL dereference to occur if the
transport is not up. In this case, a log message is written which uses a
variable that has been assigned to NULL. This variable is later assigned
a transport context.

Move the assignment before the error case where the log message is
written. In addition, make some other minor cleanups.

P4 Changelist: 8553656

Change-Id: I4be8284a22ec9687b579fbcb55e68a362bec7830
2 files changed