lkml.org 
[lkml]   [2015]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] Avoid null-pointer access in w1/slaves/w1_therm
Date
Hi

10.03.2015, 02:09, "David Fries" <david@fries.net>:

> diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
> index 1f11a20..39a9e6a 100644
> --- a/drivers/w1/slaves/w1_therm.c
> +++ b/drivers/w1/slaves/w1_therm.c
> @@ -59,9 +59,20 @@ MODULE_ALIAS("w1-family-" __stringify(W1_THERM_DS28EA00));
>  static int w1_strong_pullup = 1;
>  module_param_named(strong_pullup, w1_strong_pullup, int, 0);
>
> +struct w1_therm_family_data {
> + uint8_t rom[9];
> + struct mutex lock;
> +};

This approach will not scale to other w1 families, I would rather prefer solutions on w1 level,
not in particular drivers. What if we drop slave reference counter at all in favor of automatic sysfs device management?


\
 
 \ /
  Last update: 2015-03-10 15:21    [W:0.100 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site