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] [day] [month] [year] [list]
Message-ID: <7855953c52961f3d1d9992f0b4303eadee3fe724.camel@mediatek.com>
Date:   Tue, 3 Oct 2023 03:34:10 +0000
From:   Jason-JH Lin (林睿祥) 
        <Jason-JH.Lin@...iatek.com>
To:     "angelogioacchino.delregno@...labora.com" 
        <angelogioacchino.delregno@...labora.com>,
        "chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>
CC:     "linux-mediatek@...ts.infradead.org" 
        <linux-mediatek@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Singo Chang (張興國) 
        <Singo.Chang@...iatek.com>,
        Johnson Wang (王聖鑫) 
        <Johnson.Wang@...iatek.com>,
        Jason-ch Chen (陳建豪) 
        <Jason-ch.Chen@...iatek.com>,
        Shawn Sung (宋孝謙) 
        <Shawn.Sung@...iatek.com>,
        Nancy Lin (林欣螢) <Nancy.Lin@...iatek.com>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        Project_Global_Chrome_Upstream_Group 
        <Project_Global_Chrome_Upstream_Group@...iatek.com>,
        Nathan Lu (呂東霖) <Nathan.Lu@...iatek.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "matthias.bgg@...il.com" <matthias.bgg@...il.com>
Subject: Re: [PATCH v10 5/9] drm/mediatek: Add connector dynamic selection
 capability

Hi Angelo,

Thanks for the reviews.

[snip]

> > > > 
> > > > +
> > > > +	if (ret <= 0) {
> > > > +		DRM_INFO("Failed to find comp in ddp table, ret
> > > > =%d\n",
> > > > ret);
> > > > +		ret = 0;
> > > 
> > > Why are you returning 0 for error here?!
> > 
> > Because this function return 0 means not found any valid crtc bits.
> > Should I change this?
> > 
> 
> Yes, please, return a relevant error code instead.
> 

I found that the return type of this function is 'unsigned int', I
think returning error code instead will change the original behavior of
returning 0 as not finding any possible crtc.

e.g. drm_encoder_ok() in drm_encoder.h will check:
!!(encoder->possible_crtcs & drm_crtc_mask(crtc))

The negative error code convert to unsigned int will be a huge number
and that may cause the unexpected result here.

Regards,
Jason-JH.Lin

> Thanks,
> Angelo
> 
> > Regards,
> > Jason-JH.Lin
> > 
> > > 
> > > > +	}
> > > >    
> > > >    	return ret;
> > > >    }
> > > 
> > > Regards,
> > > Angelo
> > > 
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ