msm: Check for NULL buffers when freeing

When attempting to unmap a buffer, check if the buffer
is an ERR_PTR or NULL.

Change-Id: I6ab7751f3ba1918360d73892606e24d5d7fedcfd
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
diff --git a/arch/arm/mach-msm/subsystem_map.c b/arch/arm/mach-msm/subsystem_map.c
index db9ab30..b5ff244 100644
--- a/arch/arm/mach-msm/subsystem_map.c
+++ b/arch/arm/mach-msm/subsystem_map.c
@@ -440,6 +440,9 @@
 	int i, j, ret;
 	unsigned long temp_va;
 
+	if (IS_ERR_OR_NULL(buf))
+		goto out;
+
 	if (buf->vaddr)
 		node = find_buffer(buf->vaddr);
 	else