aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/module.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/base/module.c b/drivers/base/module.c
index f32f2f9b7be5..db930d3ee312 100644
--- a/drivers/base/module.c
+++ b/drivers/base/module.c
@@ -15,12 +15,10 @@ static char *make_driver_name(struct device_driver *drv)
15{ 15{
16 char *driver_name; 16 char *driver_name;
17 17
18 driver_name = kmalloc(strlen(drv->name) + strlen(drv->bus->name) + 2, 18 driver_name = kasprintf(GFP_KERNEL, "%s:%s", drv->bus->name, drv->name);
19 GFP_KERNEL);
20 if (!driver_name) 19 if (!driver_name)
21 return NULL; 20 return NULL;
22 21
23 sprintf(driver_name, "%s:%s", drv->bus->name, drv->name);
24 return driver_name; 22 return driver_name;
25} 23}
26 24