[PATCH 1/6] drm/i915: Allow late allocation of request for i915_add_request()

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

 



On Thu, 12 Jul 2012 19:43:47 +0200, Daniel Vetter <daniel at ffwll.ch> wrote:
> On Thu, Jul 12, 2012 at 04:13:34PM +0100, Chris Wilson wrote:
> >  	ret = ring->add_request(ring, &seqno);
> >  	if (ret)
> > -	    return ret;
> > +		return ret;
> > +
> > +	if (request == NULL) {
> > +		request = kmalloc(sizeof(*request), GFP_KERNEL);
> > +		if (request == NULL)
> > +			return -ENOMEM;
> > +	}
> 
> Hm, shouldn't we try to allocate the request struct before we emit the
> request? Otherwise looks good.

I considered the ordering immaterial so went with the cleanest error
path.

If the allocation fails after we add the breadcrumb, we will then reuse
the olr for further batches.... Oops.

I was wrong, it matters.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux