瀏覽代碼

common: avb_verify: Fix never-occurring avb_free(ops_data)

Cppcheck (v1.85) reports w/o this patch:

[common/avb_verify.c:738] -> [common/avb_verify.c:741]: (warning) \
  Either the condition 'ops' is redundant or there is possible null \
  pointer dereference: ops.

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Eugeniu Rosca 6 年之前
父節點
當前提交
47e41631bb
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      common/avb_verify.c

+ 1 - 1
common/avb_verify.c

@@ -766,7 +766,7 @@ void avb_ops_free(AvbOps *ops)
 {
 	struct AvbOpsData *ops_data;
 
-	if (ops)
+	if (!ops)
 		return;
 
 	ops_data = ops->user_data;