[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging-4.12] bitmap: fix bitmap_fill with zero-sized bitmap



commit 33f128df08e2b5236e422c0f30ad90d8cbcaedf9
Author:     Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Tue Jun 4 15:35:35 2019 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Jun 4 15:35:35 2019 +0200

    bitmap: fix bitmap_fill with zero-sized bitmap
    
    When bitmap_fill(..., 0) is called, do not try to write anything. Before
    this patch, it tried to write almost LONG_MAX, surely overwriting
    something.
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: 93df28be2d4f620caf18109222d046355ac56327
    master date: 2019-05-13 10:12:00 +0200
---
 xen/include/xen/bitmap.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h
index fe3c720e82..0430c1ce2a 100644
--- a/xen/include/xen/bitmap.h
+++ b/xen/include/xen/bitmap.h
@@ -126,6 +126,8 @@ static inline void bitmap_fill(unsigned long *dst, int 
nbits)
        size_t nlongs = BITS_TO_LONGS(nbits);
 
        switch (nlongs) {
+       case 0:
+               break;
        default:
                memset(dst, -1, (nlongs - 1) * sizeof(unsigned long));
                /* fall through */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.