lkml.org 
[lkml]   [2020]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] regmap: debugfs: Add back in erroneously removed initialisation of ret
On Fri, Sep 18, 2020 at 12:20:02PM +0100, Charles Keepax wrote:
> Fixes: 94cc89eb8fa5 ("regmap: debugfs: Fix handling of name string for debugfs init delays")
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> ---
> drivers/base/regmap/regmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
> index d0f7cc574ff34..b24f14ea96d8a 100644
> --- a/drivers/base/regmap/regmap.c
> +++ b/drivers/base/regmap/regmap.c
> @@ -706,9 +706,9 @@ struct regmap *__regmap_init(struct device *dev,
> const char *lock_name)
> {
> struct regmap *map;
> + int ret = -EINVAL;
> enum regmap_endian reg_endian, val_endian;
> int i, j;
> - int ret;
>
> if (!config)
> goto err;

Hi Charles, this isn't enough. There are several goto err_map; paths
were "ret" is zero. That will result in an Oops in the caller. It has
to be an error code.

regards,
dan carpenter

\
 
 \ /
  Last update: 2020-09-18 14:39    [W:0.059 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site