[PATCH] fbdev: chipsfb: Fix error codes in chipsfb_pci_init()

Dan Carpenter error27 at gmail.com
Mon Feb 27 10:27:53 UTC 2023


On Mon, Feb 27, 2023 at 11:13:19AM +0100, Thomas Zimmermann wrote:
> Hi
> 
> Am 27.02.23 um 11:07 schrieb Dan Carpenter:
> > The error codes are not set on these error paths.
> > 
> > Fixes: 145eed48de27 ("fbdev: Remove conflicting devices on PCI bus")
> > Signed-off-by: Dan Carpenter <error27 at gmail.com>
> 
> Reviewed-by: Thomas Zimmermann <tzimmermann at suse.de>
> 
> with the comments below addressed.
> 
> > ---
> >   drivers/video/fbdev/chipsfb.c | 14 ++++++++++----
> >   1 file changed, 10 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/video/fbdev/chipsfb.c b/drivers/video/fbdev/chipsfb.c
> > index cc37ec3f8fc1..98398789528a 100644
> > --- a/drivers/video/fbdev/chipsfb.c
> > +++ b/drivers/video/fbdev/chipsfb.c
> > @@ -358,16 +358,21 @@ static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
> >   	if (rc)
> >   		return rc;
> > -	if (pci_enable_device(dp) < 0) {
> > +	rc = pci_enable_device(dp);
> > +	if (rc < 0) {
> >   		dev_err(&dp->dev, "Cannot enable PCI device\n");
> >   		goto err_out;
> >   	}
> > -	if ((dp->resource[0].flags & IORESOURCE_MEM) == 0)
> > +	if ((dp->resource[0].flags & IORESOURCE_MEM) == 0) {
> > +		rc = -EINVAL;
> 
> I think ENODEV is more appropriate. And it's the default value from the
> original code.

Sorry, I read the original code and my mind saw -EINVAL where it was
actually -ENODEV as you say.  Will resend.

regards,
dan carpenter



More information about the dri-devel mailing list