提交 177a4324 编写于 作者: A Alexander Nyberg 提交者: Greg KH

[PATCH] Hotplug: Make dev->bus checking consistent

Earlier in the same function dev->bus is checked before dereferenced,
make consistent although I honestly don't know if dev->bus could
ever be NULL

Found by the Coverity tool
Signed-off-by: NAlexander Nyberg <alexn@dsv.su.se>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 897f5ab2
...@@ -139,7 +139,7 @@ static int dev_hotplug(struct kset *kset, struct kobject *kobj, char **envp, ...@@ -139,7 +139,7 @@ static int dev_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
buffer = &buffer[length]; buffer = &buffer[length];
buffer_size -= length; buffer_size -= length;
if (dev->bus->hotplug) { if (dev->bus && dev->bus->hotplug) {
/* have the bus specific function add its stuff */ /* have the bus specific function add its stuff */
retval = dev->bus->hotplug (dev, envp, num_envp, buffer, buffer_size); retval = dev->bus->hotplug (dev, envp, num_envp, buffer, buffer_size);
if (retval) { if (retval) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册