sna: move up the assert check before DBG print message
PATCH 1/1 sna: move up the assert check before DBG print message
The assert check for c->bo should be done before DBG, else it will hit memory access violation when c->bo is null.
--- src/sna/sna_dri2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/sna/sna_dri2.c +1 -1
@@ -278,9 +278,9 @@ sna_dri2_get_back(struct sna *sna, bo =NULL ;list_for_each_entry (c, &priv->cache, link) { +assert (c->bo);DBG (("%s: cache: handle=%d, active=%d\n" , __FUNCTION__, c->bo ? c->bo->handle :0 , c->bo ? c->bo->active_scanout :-1 )); -assert (c->bo);if (c->bo->active_scanout ==0 ) { bo = c->bo; name = c->name;
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Lim Siew Hoon
The assert check for
c->boshould be done before DBG, else it will hit memory access violation whenc->bois null.Signed-off-by Lim Siew Hoon <[email protected]>Reviewed-by Matt Roper <[email protected]>
Pardon? With a r-b?
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 9 lines · Lim Siew Hoon
Quoted 5 lines
The assert check for
c->boshould be done before DBG, else it will hit memory access violation whenc->bois null.Signed-off-by Lim Siew Hoon <[email protected]>Reviewed-by Matt Roper <[email protected]>Pardon? With a r-b?
What is a r-b?
I'm helping to fix the KW issue hit in our repo side.
I suggest the assert checking should be move up before DBG(...) print statement to avoid memory access violation happen if c->bo is NULL for print message. Of cause the chance will be very low to get c->bo is NULL.
...siewhoon
Quoted 4 lines
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 11 lines · Siew Hoon
Quoted 9 lines · Lim Siew Hoon
Quoted 5 lines
The assert check for
c->boshould be done before DBG, else it will hit memory access violation whenc->bois null.Signed-off-by Lim Siew Hoon <[email protected]>Reviewed-by Matt Roper <[email protected]>Pardon? With a r-b?
What is a r-b?
Reviewed-by.
Quoted 1 line
I'm helping to fix the KW issue hit in our repo side.
There is no bug in the code, just kw. It is a ternary operator guarding the dereference.
Quoted 2 lines
I suggest the assert checking should be move up before DBG(...) print statement to avoid memory access violation happen if
c->bois NULL for print message. Of cause the chance will be very low to getc->bois NULL.
If you look at the code if prints handle=0 if c->bo to indicate the NULL. Please read the code first.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Siew Hoon
Quoted 5 lines
Quoted 5 lines · Lim Siew Hoon
Quoted 3 lines
The assert check for
c->boshould be done before DBG, else it will hit memory access violation whenc->bois null.
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Signed-off-by Lim Siew Hoon <[email protected]>Reviewed-by Matt Roper <[email protected]>Pardon? With a r-b?
What is a r-b?
Reviewed-by.
ohh....sorry about this. It should another 1 lines signed-off-by after Reviewed-by.
Quoted 6 lines
Quoted 2 lines
I'm helping to fix the KW issue hit in our repo side.
There is no bug in the code, just kw. It is a ternary operator guarding the dereference.
Quoted 7 lines
Quoted 1 line
I suggest the assert checking should be move up before DBG(...) print
statement to avoid memory access violation happen if
c->bois NULL for print message.Quoted 1 line
Of cause the chance will be very low to get
c->bois NULL.If you look at the code if prints handle=0 if
c->boto indicate the NULL. Please read the code first.
Oh...ok. And you are right. Thank you for feedback.
Quoted 4 lines
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx