summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2016-08-21 20:27:02 +0200
committerAlex Deucher <alexander.deucher@amd.com>2016-08-23 13:48:05 -0400
commitbb1800caf773eb8d819e0964c7efd96efe435fa1 (patch)
treee0a06cfe7381110bdff226c368da047d0590cc22
parentd36f3e048e1e81906c776760d70e06bce366ef65 (diff)
downloadop-kernel-dev-bb1800caf773eb8d819e0964c7efd96efe435fa1.zip
op-kernel-dev-bb1800caf773eb8d819e0964c7efd96efe435fa1.tar.gz
drm/amd/powerplay: avoid NULL dereference, cz_hwmgr.c
if (a == NULL || a->b == NULL) leads to a NULL pointer dereference if a == NULL. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
index b75fb12..5ecef17 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
@@ -1218,7 +1218,7 @@ static int cz_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
static int cz_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
{
- if (hwmgr != NULL || hwmgr->backend != NULL) {
+ if (hwmgr != NULL && hwmgr->backend != NULL) {
kfree(hwmgr->backend);
kfree(hwmgr);
}
OpenPOWER on IntegriCloud