Commit f8ea08bb authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

irmap: don't try to dereference a null pointer

irmap_revalidate() sets a cursor to the next element or null,
then we try to dereference cursor->next in the for statemant.
Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 70afb3bd
...@@ -243,10 +243,12 @@ char *irmap_lookup(unsigned int s_dev, unsigned long i_ino) ...@@ -243,10 +243,12 @@ char *irmap_lookup(unsigned int s_dev, unsigned long i_ino)
timing_start(TIME_IRMAP_RESOLVE); timing_start(TIME_IRMAP_RESOLVE);
hv = irmap_hashfn(s_dev, i_ino); hv = irmap_hashfn(s_dev, i_ino);
for (p = &cache[hv]; *p; p = &(*p)->next) { for (p = &cache[hv]; *p; ) {
c = *p; c = *p;
if (!(c->dev == s_dev && c->ino == i_ino)) if (!(c->dev == s_dev && c->ino == i_ino)) {
p = &(*p)->next;
continue; continue;
}
if (c->revalidate && irmap_revalidate(c, p)) if (c->revalidate && irmap_revalidate(c, p))
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment