From 7c5897933f4f64594602b2e38264af705c061754 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 5 Aug 2015 18:11:59 +0200 Subject: Use global locks to protect kmem allocation to prevent race while allocating simmultaneously locking kmem pages and any other type of kmem --- pcilib/lock.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pcilib/lock.c') diff --git a/pcilib/lock.c b/pcilib/lock.c index f1cbc56..13e363a 100644 --- a/pcilib/lock.c +++ b/pcilib/lock.c @@ -140,7 +140,10 @@ const char *pcilib_lock_get_name(pcilib_lock_t *lock) { int pcilib_lock_custom(pcilib_lock_t *lock, pcilib_lock_flags_t flags, pcilib_timeout_t timeout) { int err; - if (!lock) return 0; + if (!lock) { + pcilib_error("The null lock pointer is passed to lock function"); + return PCILIB_ERROR_INVALID_ARGUMENT; + } struct timespec tm; -- cgit v1.2.3