From: Gustavo Sverzut Barbieri Date: Mon, 12 Dec 2011 20:28:52 +0000 (-0200) Subject: handle case where modname was not detected. X-Git-Tag: v1~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=973c80ba7c4e38f1d4fb54ae9258b1977b3c3f12;p=platform%2Fupstream%2Fkmod.git handle case where modname was not detected. --- diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c index ee1be6d..1e14191 100644 --- a/libkmod/libkmod-module.c +++ b/libkmod/libkmod-module.c @@ -248,7 +248,10 @@ KMOD_EXPORT int kmod_module_new_from_path(struct kmod_ctx *ctx, return -errno; } - path_to_modname(path, name, &namelen); + if (path_to_modname(path, name, &namelen) == NULL) { + free(abspath); + return -ENOENT; + } m = kmod_pool_get_module(ctx, name); if (m != NULL) {