2019-03-29 14:12:17 +08:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2019-03-22 14:52:12 +08:00
|
|
|
From: "Wood, Brian J" <brian.j.wood@intel.com>
|
|
|
|
Date: Thu, 14 Mar 2019 15:34:34 -0700
|
2019-03-29 14:12:17 +08:00
|
|
|
Subject: [PATCH] media: pci: Fix improper use of pointer before check
|
2019-03-22 14:52:12 +08:00
|
|
|
|
|
|
|
This fixes the case where the function get_mem_sub_system()
|
|
|
|
returns NULL and the use of wrapper_base pointer.
|
|
|
|
|
|
|
|
Tracked-On:PKT-1813
|
|
|
|
Change-Id: I8a3e73b83a43f747dfa6fb3401c05a0eecf5bd96
|
|
|
|
Signed-off-by: Wood, Brian J <brian.j.wood@intel.com>
|
|
|
|
---
|
|
|
|
drivers/media/pci/intel/ipu-wrapper.c | 5 +++++
|
|
|
|
1 file changed, 5 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/drivers/media/pci/intel/ipu-wrapper.c b/drivers/media/pci/intel/ipu-wrapper.c
|
2020-10-27 02:14:06 +08:00
|
|
|
index 47fa06202fdd..047c1f2ee2cf 100644
|
2019-03-22 14:52:12 +08:00
|
|
|
--- a/drivers/media/pci/intel/ipu-wrapper.c
|
|
|
|
+++ b/drivers/media/pci/intel/ipu-wrapper.c
|
|
|
|
@@ -307,6 +307,11 @@ u32 shared_memory_map(unsigned int ssid, unsigned int mmid, u64 addr)
|
|
|
|
struct my_css_memory_buffer_item *buf = NULL;
|
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
+ if (!mine) {
|
|
|
|
+ pr_err("Invalid mem subsystem, return NULL");
|
|
|
|
+ return NULL;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
if ((void *)(unsigned long)addr == &alloc_cookie)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
--
|
2019-04-08 18:08:36 +08:00
|
|
|
https://clearlinux.org
|
2019-03-22 14:52:12 +08:00
|
|
|
|