openwrt/target/linux/brcm2708/patches-4.19/950-0207-vcsm-Fix-an-NULL-dereference-in-the-import_dmabuf-er.patch
Álvaro Fernández Rojas 4295485719 brcm2708: add linux 4.19 support
Boot tested on Raspberry Pi B+ (BCM2708) and Raspberry Pi 2 (BCM2709)

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2019-07-14 12:44:14 +02:00

26 lines
798 B
Diff

From fb5cef781e09bb78ca095f8f5780952f996115f1 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
Date: Wed, 14 Nov 2018 11:54:46 +0000
Subject: [PATCH 207/703] vcsm: Fix an NULL dereference in the import_dmabuf
error path
resource was dereferenced even though it was NULL.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
---
drivers/char/broadcom/vc_sm/vmcs_sm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/char/broadcom/vc_sm/vmcs_sm.c
+++ b/drivers/char/broadcom/vc_sm/vmcs_sm.c
@@ -2315,8 +2315,8 @@ int vc_sm_ioctl_import_dmabuf(struct sm_
return 0;
error:
- resource->res_stats[IMPORT_FAIL]++;
if (resource) {
+ resource->res_stats[IMPORT_FAIL]++;
vc_sm_resource_deceased(resource, 1);
kfree(resource);
}