Mesa (staging/18.1): swr: Remove unnecessary memset call
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Aug 2 18:12:16 UTC 2018
Module: Mesa
Branch: staging/18.1
Commit: dbcc6decdcda97412ee5656b5b9971c2676486d4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dbcc6decdcda97412ee5656b5b9971c2676486d4
Author: Vlad Golovkin <vlad.golovkin.mail at gmail.com>
Date: Wed Aug 1 20:56:23 2018 +0300
swr: Remove unnecessary memset call
Zeroing memory after calloc is not necessary. This also allows to avoid
possible crash when allocation fails, because memset is called before
checking screen for NULL.
Fixes: a29d63ecf71546c4798c6 "swr: refactor swr_create_screen to allow
for proper cleanup on error"
Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>
(cherry picked from commit 9d3a2394e4d3f91f1e23a971ce34aaf031a1e777)
---
src/gallium/drivers/swr/swr_screen.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp
index 880a177c39..4e43ac55fb 100644
--- a/src/gallium/drivers/swr/swr_screen.cpp
+++ b/src/gallium/drivers/swr/swr_screen.cpp
@@ -1130,7 +1130,6 @@ struct pipe_screen *
swr_create_screen_internal(struct sw_winsys *winsys)
{
struct swr_screen *screen = CALLOC_STRUCT(swr_screen);
- memset(screen, 0, sizeof(struct swr_screen));
if (!screen)
return NULL;
More information about the mesa-commit
mailing list