This is a partial revert of commit
'Stop annoying prio_lookup warning messages',
as that patch would only fix the 'prio_put' case.
However, as the prio name might be empty even in
in prio_get() we should rather fix this in
prio_lookup() and handle both cases.
Signed-off-by: Hannes Reinecke <hare@suse.de>
{
struct prio * p;
+ if (!name || !strlen(name))
+ return NULL;
+
list_for_each_entry(p, &prioritizers, node) {
if (!strncmp(name, p->name, PRIO_NAME_LEN))
return p;
if (!dst)
return;
- if (!strlen(dst->name))
- src = NULL;
- else
- src = prio_lookup(dst->name);
+ src = prio_lookup(dst->name);
memset(dst, 0x0, sizeof(struct prio));
free_prio(src);
}