|
From: | Christoph Hellwig |
Subject: | Re: [Qemu-devel] [PATCH 08/10] qcow2: Allow updating no refcounts |
Date: | Tue, 19 Jan 2010 19:53:28 +0100 |
User-agent: | Mutt/1.3.28i |
> #endif > - if (length <= 0) > + if (length < 0) { > return -EINVAL; > + } > + > start = offset & ~(s->cluster_size - 1); > last = (offset + length - 1) & ~(s->cluster_size - 1); > for(cluster_offset = start; cluster_offset <= last; So for legnth = 0, last will equal start and we'll never go through the loop. But should we really bother with all the other work in the function or just return 0 early on?
[Prev in Thread] | Current Thread | [Next in Thread] |