Fix unreachable code when using unregister_notifier() by returning the
error code if failed. Before this patch, the usage code of
unregister_notifier() is not able to receive the any error code.
Change-Id: I1bf9575a05b8dd2ca1c47e26e063dc90dbf892e0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
GList *n;
struct device_notifier *notifier;
+ if (status >= DEVICE_NOTIFIER_MAX || !func)
+ return -EINVAL;
+
for (n = device_notifier_list; n != NULL; n = n->next) {
notifier = n->data;
if ((notifier->status == status) &&