tile-srom and krealloc with __GFP_ZERO defect

From: Joe Perches
Date: Thu Jul 28 2016 - 13:27:28 EST


Hello Chris,

There is a defect in krealloc with __GFP_ZERO so this code in
drivers/chat/tile-srom.c may not work properly:

drivers/char/tile-srom.c-       for (i = 0; ; i++) {
drivers/char/tile-srom.c-               int devhdl;
drivers/char/tile-srom.c-               char buf[20];
drivers/char/tile-srom.c-               struct srom_dev *new_srom_devices =
drivers/char/tile-srom.c-                       krealloc(srom_devices, (i+1) * sizeof(struct srom_dev),
drivers/char/tile-srom.c:                                GFP_KERNEL | __GFP_ZERO);
drivers/char/tile-srom.c-               if (!new_srom_devices) {
drivers/char/tile-srom.c-                       result = -ENOMEM;
drivers/char/tile-srom.c-                       goto fail_mem;
drivers/char/tile-srom.c-               }
drivers/char/tile-srom.c-               srom_devices = new_srom_devices;

http://linux-kernel.vger.kernel.narkive.com/xyiQV3vf/slab-krealloc-with-gfp-zero-defect