Tomeu Vizoso fd4c5b9668 panfrost: Don't access members of NULL pointers
This fixes the following UBSAN warning:

../mesa/src/gallium/drivers/panfrost/pan_resource.c:889:16: runtime error: member access within null pointer of type 'struct panfrost_resource'
    #0 0xffff79787a1c in panfrost_resource_get_stencil ../mesa/src/gallium/drivers/panfrost/pan_resource.c:889
    #1 0xffff7997af44 in u_transfer_helper_resource_destroy ../mesa/src/gallium/auxiliary/util/u_transfer_helper.c:141
    #2 0xffff77187f14 in pipe_resource_reference ../mesa/src/gallium/auxiliary/util/u_inlines.h:150
    #3 0xffff77187f14 in st_bufferobj_free ../mesa/src/mesa/state_tracker/st_cb_bufferobjects.c:87
    #4 0xffff774be848 in _mesa_reference_buffer_object_ ../mesa/src/mesa/main/bufferobj.c:504
    #5 0xffff77c2cb3c in _vbo_DestroyContext ../mesa/src/mesa/vbo/vbo_context.c:208
    #6 0xffff771bd854 in st_destroy_context ../mesa/src/mesa/state_tracker/st_context.c:1082
    #7 0xffff76f4b3cc in dri_destroy_context ../mesa/src/gallium/state_trackers/dri/dri_context.c:245
    #8 0xffff76f298a0 in driDestroyContext ../mesa/src/mesa/drivers/dri/common/dri_util.c:528
    #9 0xffff863ac118 in dri2_destroy_context ../mesa/src/egl/drivers/dri2/egl_dri2.c:1463
    #10 0xffff86372484 in eglDestroyContext ../mesa/src/egl/main/eglapi.c:826
    #11 0xaaaabf5ebe24 in tcu::surfaceless::EglRenderContext::~EglRenderContext() (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x63e24)
    #12 0xaaaabf5ebeb8 in tcu::surfaceless::EglRenderContext::~EglRenderContext() (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x63eb8)
    #13 0xaaaabf5ece30 in deqp::gles2::TestPackage::deinit() (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x64e30)
    #14 0xaaaabfaabad0 in tcu::TestHierarchyIterator::next() (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x523ad0)
    #15 0xaaaabfa7b65c in tcu::TestSessionExecutor::iterate() (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x4f365c)
    #16 0xaaaabfa5a564 in tcu::App::iterate() (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x4d2564)
    #17 0xaaaabf5ea20c in main (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x6220c)
    #18 0xffff85d322a8 in __libc_start_main ../csu/libc-start.c:308
    #19 0xaaaabf5ea8dc  (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x628dc)

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10695>
2021-05-10 17:02:09 +00:00
2021-05-07 13:41:38 +00:00
2020-01-18 11:39:32 +01:00
2021-03-20 10:38:55 +00:00
2021-05-10 15:34:07 +00:00
2021-05-05 18:53:08 +00:00
2021-04-14 21:11:07 +00:00

`Mesa <https://mesa3d.org>`_ - The 3D Graphics Library
======================================================


Source
------

This repository lives at https://gitlab.freedesktop.org/mesa/mesa.
Other repositories are likely forks, and code found there is not supported.


Build & install
---------------

You can find more information in our documentation (`docs/install.rst
<https://mesa3d.org/install.html>`_), but the recommended way is to use
Meson (`docs/meson.rst <https://mesa3d.org/meson.html>`_):

.. code-block:: sh

  $ mkdir build
  $ cd build
  $ meson ..
  $ sudo ninja install


Support
-------

Many Mesa devs hang on IRC; if you're not sure which channel is
appropriate, you should ask your question on `Freenode's #dri-devel
<irc://chat.freenode.net#dri-devel>`_, someone will redirect you if
necessary.
Remember that not everyone is in the same timezone as you, so it might
take a while before someone qualified sees your question.
To figure out who you're talking to, or which nick to ping for your
question, check out `Who's Who on IRC
<https://dri.freedesktop.org/wiki/WhosWho/>`_.

The next best option is to ask your question in an email to the
mailing lists: `mesa-dev\@lists.freedesktop.org
<https://lists.freedesktop.org/mailman/listinfo/mesa-dev>`_


Bug reports
-----------

If you think something isn't working properly, please file a bug report
(`docs/bugs.rst <https://mesa3d.org/bugs.html>`_).


Contributing
------------

Contributions are welcome, and step-by-step instructions can be found in our
documentation (`docs/submittingpatches.rst
<https://mesa3d.org/submittingpatches.html>`_).

Note that Mesa uses gitlab for patches submission, review and discussions.
S
Description
No description provided
Readme 538 MiB
Languages
C 75.5%
C++ 17.2%
Python 2.7%
Rust 1.8%
Assembly 1.5%
Other 1%