Merge branch 'component-for-driver' of git://ftp.arm.linux.org.uk/~rmk/linux-arm...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Jul 2014 01:28:32 +0000 (18:28 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Jul 2014 01:28:32 +0000 (18:28 -0700)
Russell writes:

Greg,

Please incorporate a fix for the component helper.
This fixes a bug reported by Sachin Kamat found with Exynos DRM.

drivers/base/component.c

index b4236daed4fa0401cf90827f422ab281936ba9c1..f748430bb654154918ae67984405021835f44ec8 100644 (file)
@@ -293,10 +293,12 @@ int component_master_add_with_match(struct device *dev,
        if (ops->add_components && match)
                return -EINVAL;
 
-       /* Reallocate the match array for its true size */
-       match = component_match_realloc(dev, match, match->num);
-       if (IS_ERR(match))
-               return PTR_ERR(match);
+       if (match) {
+               /* Reallocate the match array for its true size */
+               match = component_match_realloc(dev, match, match->num);
+               if (IS_ERR(match))
+                       return PTR_ERR(match);
+       }
 
        master = kzalloc(sizeof(*master), GFP_KERNEL);
        if (!master)