linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* tile-srom and krealloc with __GFP_ZERO defect
@ 2016-07-28 17:27 Joe Perches
  2016-07-28 18:11 ` possible krealloc with __GFP_ZERO defects Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2016-07-28 17:27 UTC (permalink / raw)
  To: Chris Metcalf; +Cc: LKML

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-05 15:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-28 17:27 tile-srom and krealloc with __GFP_ZERO defect Joe Perches
2016-07-28 18:11 ` possible krealloc with __GFP_ZERO defects Joe Perches
2016-07-28 19:07   ` [PATCH] tile-srom: avoid krealloc(... __GFP_ZERO) pattern Chris Metcalf
2016-08-05 11:37   ` possible krealloc with __GFP_ZERO defects Matt Fleming
2016-08-05 15:25     ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).