[COMMON] media: mfc: check whether itmon info's dest is NULL.
authorSunyoung Kang <sy0816.kang@samsung.com>
Thu, 2 Aug 2018 05:07:43 +0000 (14:07 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:03 +0000 (20:23 +0300)
Change-Id: Ie2d25d8880dd10497a5d2fc4409e3a3323571916
Signed-off-by: Sunyoung Kang <sy0816.kang@samsung.com>
drivers/media/platform/exynos/mfc/mfc.c

index 2e30538d533ab2c70fcac3051ba68022f91249cc..43a404d4796e5e0346324e19536198bc987fc624 100644 (file)
@@ -1233,14 +1233,15 @@ static int __mfc_itmon_notifier(struct notifier_block *nb, unsigned long action,
                return NOTIFY_DONE;
 
        /* print dump if it is an MFC ITMON error */
-       if (strncmp("MFC", itmon_info->port, sizeof("MFC") - 1) == 0) {
-               if (!itmon_info->master)
-                       return NOTIFY_DONE;
-               if (strncmp("MFC", itmon_info->master, sizeof("MFC") - 1) == 0) {
+       if (itmon_info->port &&
+                       strncmp("MFC", itmon_info->port, sizeof("MFC") - 1) == 0) {
+               if (itmon_info->master &&
+                       strncmp("MFC", itmon_info->master, sizeof("MFC") - 1) == 0) {
                        is_mfc_itmon = 1;
                        is_master = 1;
                }
-       } else if (strncmp("MFC", itmon_info->dest, sizeof("MFC") - 1) == 0) {
+       } else if (itmon_info->dest &&
+                       strncmp("MFC", itmon_info->dest, sizeof("MFC") - 1) == 0) {
                is_mfc_itmon = 1;
                is_master = 0;
        }