Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1452021

tile-srom and krealloc with __GFP_ZERO defect

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject tile-srom and krealloc with __GFP_ZERO defect
Date 2016-07-28 19:30 +0200
Message-ID <rZXi9-St-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

tile-srom and krealloc with __GFP_ZERO defect Joe Perches <joe@perches.com> - 2016-07-28 19:30 +0200
  possible krealloc with __GFP_ZERO defects Joe Perches <joe@perches.com> - 2016-07-28 20:20 +0200
    [PATCH] tile-srom: avoid krealloc(... __GFP_ZERO) pattern Chris Metcalf <cmetcalf@mellanox.com> - 2016-07-28 21:10 +0200
    Re: possible krealloc with __GFP_ZERO defects Matt Fleming <matt@codeblueprint.co.uk> - 2016-08-05 13:40 +0200
      Re: possible krealloc with __GFP_ZERO defects Joe Perches <joe@perches.com> - 2016-08-05 17:30 +0200

csiph-web