[PATCH 2/2] staging : Comedi : comedi_fops : Fixed the return error code

Santosh santhosh.pai88 at yahoo.com
Wed Jun 24 17:52:24 UTC 2015


  try_module_get fails when the reference count of the module is not
  allowed to be incremented ,and hence -ENXIO is returned indicating
  no device or address.

Signed-off-by: santhosh pai <santhosh.pai88 at yahoo.com>
---
 drivers/staging/comedi/comedi_fops.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index d6a37e9..1ab443c 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2606,7 +2606,7 @@ static int comedi_open(struct inode *inode, struct file *file)
 	}
 	if (dev->attached && dev->use_count == 0) {
 		if (!try_module_get(dev->driver->module)) {
-			rc = -EPERM;
+			rc = -ENXIO;
 			goto out;
 		}
 		if (dev->open) {
-- 
1.7.9.5



More information about the devel mailing list