From a7546cc34ca630a54dab6c6d6ab039235b565119 Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Tue, 17 Jul 2018 13:56:47 -0700 Subject: [PATCH] staging: gasket: Return EBUSY on mapping create when already in use gasket_sysfs_create_mapping() return EBUSY if sysfs mapping already in use, as a more appropriate error code than the current return of EINVAL, which would indicate invalid parameters. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman --- gasket_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gasket_sysfs.c b/gasket_sysfs.c index e3d7706..dd4d3aa 100644 --- a/gasket_sysfs.c +++ b/gasket_sysfs.c @@ -194,7 +194,7 @@ int gasket_sysfs_create_mapping( "0x%p.", device); put_mapping(mapping); mutex_unlock(&function_mutex); - return -EINVAL; + return -EBUSY; } /* Find the first empty entry in the array. */