aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-07 21:28:32 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-07 21:28:32 -0400
commit650f81d40957cf5bc07de1210591339c6242a361 (patch)
treed08efd2564b7139677def312872c84baf9b07d79
parent64c720add08ed48fc7655686c2de6969b043b4c0 (diff)
parentb509cc802239a8b5ba7d1d2cc5adfb9d984b7ed8 (diff)
Merge branch 'component-for-driver' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into work-next
Russell writes: Greg, Please incorporate a fix for the component helper. This fixes a bug reported by Sachin Kamat found with Exynos DRM.
-rw-r--r--drivers/base/component.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/base/component.c b/drivers/base/component.c
index b4236daed4fa..f748430bb654 100644
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -293,10 +293,12 @@ int component_master_add_with_match(struct device *dev,
293 if (ops->add_components && match) 293 if (ops->add_components && match)
294 return -EINVAL; 294 return -EINVAL;
295 295
296 /* Reallocate the match array for its true size */ 296 if (match) {
297 match = component_match_realloc(dev, match, match->num); 297 /* Reallocate the match array for its true size */
298 if (IS_ERR(match)) 298 match = component_match_realloc(dev, match, match->num);
299 return PTR_ERR(match); 299 if (IS_ERR(match))
300 return PTR_ERR(match);
301 }
300 302
301 master = kzalloc(sizeof(*master), GFP_KERNEL); 303 master = kzalloc(sizeof(*master), GFP_KERNEL);
302 if (!master) 304 if (!master)