lkml.org 
[lkml]   [2014]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] of: Fix overflow bug in string property parsing functions
Date
On Monday, November 03, 2014 11:38:24 PM Grant Likely wrote:

[cut]

> diff --git a/include/linux/of.h b/include/linux/of.h
> index 6545e7aec7bb..3b3c6e849ae8 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -267,14 +267,12 @@ extern int of_property_read_u64(const struct device_node *np,
> extern int of_property_read_string(struct device_node *np,
> const char *propname,
> const char **out_string);
> -extern int of_property_read_string_index(struct device_node *np,
> - const char *propname,
> - int index, const char **output);
> extern int of_property_match_string(struct device_node *np,
> const char *propname,
> const char *string);
> -extern int of_property_count_strings(struct device_node *np,
> - const char *propname);
> +extern int of_property_read_string_helper(struct device_node *np,
> + const char *propname,
> + const char **out_strs, size_t sz, int index);
> extern int of_device_is_compatible(const struct device_node *device,
> const char *);
> extern int of_device_is_available(const struct device_node *device);
> @@ -486,15 +484,9 @@ static inline int of_property_read_string(struct device_node *np,
> return -ENOSYS;
> }
>
> -static inline int of_property_read_string_index(struct device_node *np,
> - const char *propname, int index,
> - const char **out_string)
> -{
> - return -ENOSYS;
> -}
> -
> -static inline int of_property_count_strings(struct device_node *np,
> - const char *propname)
> +static inline int of_property_read_string_helper(struct device_node *np,
> + const char *propname,
> + char **out_strs, size_t sz, int index)

const char **out_strs, size_t sz, int index)

> {
> return -ENOSYS;
> }

Other than that, looks good to me.

Rafael



\
 
 \ /
  Last update: 2014-11-04 01:41    [W:0.042 / U:1.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site