Re: [PATCH] drm: loongson: Add a check for lsdc_bo_create() errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Basically everything in this email was wrong to a kind of shocking
degree.  For example, ignoring kmalloc() failure is a bug so the fixes
tag is definitely warranted.  But then you called me "bare brained"
which seems like a personal attack so I'm going to report this as a code
of conduct violation.

regards,
dan carpenter

On Tue, Jul 18, 2023 at 08:32:02PM +0800, suijingfeng wrote:
> Hi,
> 
> 
> Thanks for the patch.
> 
> 
> The commit title generally should be 'drm/looongson: Add a check for
> lsdc_bo_create() errors'
> 
> not 'drm: loongson: xxxx'
> 
> 
> On 2023/7/18 15:01, Dan Carpenter wrote:
> > The lsdc_bo_create() function can fail so add a check for that.
> > 
> > Fixes: f39db26c5428 ("drm: Add kms driver for loongson display controller")
> 
> Please drop this Fixes tag,  because you patch just add a error handling.
> 
> Yes,  the lsdc_bo_create() function can fail, but this is generally not
> happen.
> 
> Even if the fail happened,  your patch is not fixing the root problem.
> 
> 
> I know that you create this patch with the bare brain,
> 
> I would like hear more practical usage or bugs of this driver.
> 
> And mention more in the commit message is preferred.
> 
> 
> > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> > ---
> >   drivers/gpu/drm/loongson/lsdc_ttm.c | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/loongson/lsdc_ttm.c b/drivers/gpu/drm/loongson/lsdc_ttm.c
> > index bb0c8fd43a75..bf79dc55afa4 100644
> > --- a/drivers/gpu/drm/loongson/lsdc_ttm.c
> > +++ b/drivers/gpu/drm/loongson/lsdc_ttm.c
> > @@ -496,6 +496,8 @@ struct lsdc_bo *lsdc_bo_create_kernel_pinned(struct drm_device *ddev,
> >   	int ret;
> >   	lbo = lsdc_bo_create(ddev, domain, size, true, NULL, NULL);
> > +	if (IS_ERR(lbo))
> > +		return ERR_CAST(lbo);
> >   	ret = lsdc_bo_reserve(lbo);
> >   	if (unlikely(ret)) {



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux