lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 3 Sep 2020 16:48:41 +0100
From:   Alex Dewar <alex.dewar90@...il.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Alex Dewar <alex.dewar90@...il.com>, devel@...verdev.osuosl.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Alan Cox <alan@...ux.intel.com>
Subject: Re: [PATCH] staging: media: atomisp: Fix error path in lm3554_probe()

Good point about the timer!

> >  
> > -	err = lm3554_gpio_init(client);
> > -	if (err) {
> > +	ret = lm3554_gpio_init(client);
> > +	if (ret) {
> >  		dev_err(&client->dev, "gpio request/direction_output fail");
> > -		goto fail2;
> > +		goto err_cleanup_entity;
> >  	}
> >  	return atomisp_register_i2c_module(&flash->sd, NULL, LED_FLASH);
> 
> If atomisp_register_i2c_module() fails then we need to call
> lm3554_gpio_uninit(client) and do other cleanup.

I'm probably showing my ignorance here, but I can't see what cleanup we
need. Inside lm3554_gpio_init we have:

	ret = gpiod_direction_output(pdata->gpio_reset, 0);
	if (ret < 0)
		return ret;
	dev_info(&client->dev, "flash led reset successfully\n");

	if (!pdata->gpio_strobe)
		return -EINVAL;

	ret = gpiod_direction_output(pdata->gpio_strobe, 0);
	if (ret < 0)
		return ret;

I'm not sure how you "undo" a call to gpiod_direction_output, but I'm
thinking you won't need to do anything because it should be ok to leave
a gpio to output 0... right?

Alex

> 
> > -fail2:
> > +
> > +err_cleanup_entity:
> >  	media_entity_cleanup(&flash->sd.entity);
> > +err_free_ctrl_handler:
> >  	v4l2_ctrl_handler_free(&flash->ctrl_handler);
> 
> regards,
> dan carpenter
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ