From 2c7afd125cc482dbdf6b0a169c42337e7e76cda5 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Tue, 1 May 2007 13:46:26 +0200 Subject: Driver core: keep PHYSDEV for old struct class_device Class-devices created by "struct class_device" are going to be replaced by "struct device". Keep the deprecated PHYSDEV* variables for the already "deprecated" struct class_device" devices. Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- drivers/base/core.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/base/core.c') diff --git a/drivers/base/core.c b/drivers/base/core.c index b78fc1e68264..dd40d78a023d 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -180,10 +180,12 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj, char **envp, const char *path; path = kobject_get_path(&parent->kobj, GFP_KERNEL); - add_uevent_var(envp, num_envp, &i, - buffer, buffer_size, &length, - "PHYSDEVPATH=%s", path); - kfree(path); + if (path) { + add_uevent_var(envp, num_envp, &i, + buffer, buffer_size, &length, + "PHYSDEVPATH=%s", path); + kfree(path); + } add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length, -- cgit v1.2.3