]> Pileus Git - ~andy/linux/blobdiff - drivers/i2c/busses/scx200_acb.c
[PATCH] scx200_acb: Fix resource name use after free
[~andy/linux] / drivers / i2c / busses / scx200_acb.c
index f2dae6831142a92206d9c52e58a57804cc1cefcc..42e4e00d6c327275548ca6a1a829c5d3b1914f3d 100644 (file)
@@ -415,7 +415,6 @@ static int  __init scx200_acb_create(const char *text, int base, int index)
        struct scx200_acb_iface *iface;
        struct i2c_adapter *adapter;
        int rc;
-       char description[64];
 
        iface = kzalloc(sizeof(*iface), GFP_KERNEL);
        if (!iface) {
@@ -434,10 +433,7 @@ static int  __init scx200_acb_create(const char *text, int base, int index)
 
        mutex_init(&iface->mutex);
 
-       snprintf(description, sizeof(description), "%s ACCESS.bus [%s]",
-                text, adapter->name);
-
-       if (request_region(base, 8, description) == 0) {
+       if (!request_region(base, 8, adapter->name)) {
                printk(KERN_ERR NAME ": can't allocate io 0x%x-0x%x\n",
                        base, base + 8-1);
                rc = -EBUSY;