summaryrefslogtreecommitdiff
path: root/core/kmod/0003-modprobe-handle-all-error-returns-from-init_module.patch
blob: 5bbc93a9039e6ebc05d06c83303115f0ffd16851 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From fdf78d80d298353c29e1fe8c00602669dd9662bb Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Mon, 30 Jan 2012 23:05:26 -0500
Subject: [PATCH 3/4] modprobe: handle all error returns from init_module

---
 tools/kmod-modprobe.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c
index 3e51506..c882856 100644
--- a/tools/kmod-modprobe.c
+++ b/tools/kmod-modprobe.c
@@ -551,6 +551,8 @@ static int insmod_do_insert_module(struct kmod_module *mod, const char *opts)
 
 	err = kmod_module_insert_module(mod, flags, opts);
 	switch (err) {
+	case 0:
+		break;
 	case -EEXIST:
 		/*
 		 * We checked for EEXIST with an earlier call to
@@ -564,7 +566,7 @@ static int insmod_do_insert_module(struct kmod_module *mod, const char *opts)
 			ERR("Module %s already in kernel.\n",
 					kmod_module_get_name(mod));
 		break;
-	case -EPERM:
+	default:
 		ERR("could not insert '%s': %s\n", kmod_module_get_name(mod),
 				strerror(-err));
 		break;
-- 
1.7.9