Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma_resv: prime lockdep annotations

From d07ea81611ed6e4fb8cc290f42d23dbcca2da2f8 Mon Sep 17 00:00:00 2001
From: Steven Price <steven.price@arm.com>
Date: Mon, 11 Nov 2019 13:07:19 +0000
Subject: [PATCH] dma_resv: Correct return type of dma_resv_lockdep()

subsys_initcall() expects a function which returns 'int'. Fix
dma_resv_lockdep() so it returns an 'int' error code.

Fixes: b2a8116e2592 ("dma_resv: prime lockdep annotations")
Signed-off-by: Steven Price <steven.price@arm.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/c0a0c70d-e6fe-1103-2888-1ce1425f4a5d@arm.com

authored by

Steven Price and committed by
Daniel Vetter
ffbbaa74 be143124

+4 -2
+4 -2
drivers/dma-buf/dma-resv.c
··· 97 97 } 98 98 99 99 #if IS_ENABLED(CONFIG_LOCKDEP) 100 - static void __init dma_resv_lockdep(void) 100 + static int __init dma_resv_lockdep(void) 101 101 { 102 102 struct mm_struct *mm = mm_alloc(); 103 103 struct dma_resv obj; 104 104 105 105 if (!mm) 106 - return; 106 + return -ENOMEM; 107 107 108 108 dma_resv_init(&obj); 109 109 ··· 115 115 up_read(&mm->mmap_sem); 116 116 117 117 mmput(mm); 118 + 119 + return 0; 118 120 } 119 121 subsys_initcall(dma_resv_lockdep); 120 122 #endif