Bug 94711 - Patch for pb_reference to explicitly handle NULL src
Summary: Patch for pb_reference to explicitly handle NULL src
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: 11.1
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-26 02:55 UTC by John Wehle
Modified: 2016-03-28 08:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch for problem. (457 bytes, text/plain)
2016-03-26 02:55 UTC, John Wehle
Details

Description John Wehle 2016-03-26 02:55:31 UTC
Created attachment 122572 [details]
Patch for problem.

Noticed while looking at a crash that pb_reference is called in several
places with src set to NULL which is interesting since pb_reference then
calls pipe_reference with &src->reference.  The existing code works since
struct pb_buffer looks like:

  struct pb_buffer {
   struct pipe_reference  reference;
   ...

meaning &src->reference with src = NULL happens to equal NULL.  The
attached patch explicitly handles src = NULL which is less fragile and
clearly communicates that being passed NULL is valid.
Comment 1 Michel Dänzer 2016-03-28 08:02:41 UTC
This is not a bug but by design.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.