Revision 55860d96ca59265d35427da0ee7d7f61e404f8e7 authored by Sebastian Andrzej Siewior on 26 June 2020, 03:29:55 UTC, committed by Linus Torvalds on 26 June 2020, 07:27:37 UTC
According to Christopher Lameter two fixes have been merged for the same problem. As far as I can tell, the code does not acquire the list_lock and invoke kmalloc(). list_slab_objects() misses an unlock (the counterpart to get_map()) and the memory allocated in free_partial() isn't used. Revert the mentioned commit. Link: http://lkml.kernel.org/r/20200618201234.795692-1-bigeasy@linutronix.de Fixes: aa456c7aebb14 ("slub: remove kmalloc under list_lock from list_slab_objects() V2") Link: https://lkml.kernel.org/r/alpine.DEB.2.22.394.2006181501480.12014@www.lameter.com Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Yu Zhao <yuzhao@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8982ae5
leds-ip30.c
// SPDX-License-Identifier: GPL-2.0
/*
* LED Driver for SGI Octane machines
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/leds.h>
#define IP30_LED_SYSTEM 0
#define IP30_LED_FAULT 1
struct ip30_led {
struct led_classdev cdev;
u32 __iomem *reg;
};
static void ip30led_set(struct led_classdev *led_cdev,
enum led_brightness value)
{
struct ip30_led *led = container_of(led_cdev, struct ip30_led, cdev);
writel(value, led->reg);
}
static int ip30led_create(struct platform_device *pdev, int num)
{
struct resource *res;
struct ip30_led *data;
res = platform_get_resource(pdev, IORESOURCE_MEM, num);
if (!res)
return -EBUSY;
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;
data->reg = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(data->reg))
return PTR_ERR(data->reg);
switch (num) {
case IP30_LED_SYSTEM:
data->cdev.name = "white:power";
break;
case IP30_LED_FAULT:
data->cdev.name = "red:fault";
break;
default:
return -EINVAL;
}
data->cdev.brightness = readl(data->reg);
data->cdev.max_brightness = 1;
data->cdev.brightness_set = ip30led_set;
return devm_led_classdev_register(&pdev->dev, &data->cdev);
}
static int ip30led_probe(struct platform_device *pdev)
{
int ret;
ret = ip30led_create(pdev, IP30_LED_SYSTEM);
if (ret < 0)
return ret;
return ip30led_create(pdev, IP30_LED_FAULT);
}
static struct platform_driver ip30led_driver = {
.probe = ip30led_probe,
.driver = {
.name = "ip30-leds",
},
};
module_platform_driver(ip30led_driver);
MODULE_AUTHOR("Thomas Bogendoerfer <tbogendoerfer@suse.de>");
MODULE_DESCRIPTION("SGI Octane LED driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:ip30-leds");
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...