drm/i915/gvt: IS_ERR() vs NULL bug in intel_gvt_update_reg_whitelist()
authorjsg <jsg@openbsd.org>
Fri, 22 Jul 2022 06:02:46 +0000 (06:02 +0000)
committerjsg <jsg@openbsd.org>
Fri, 22 Jul 2022 06:02:46 +0000 (06:02 +0000)
From Dan Carpenter
f6e3ced9c60f3cab517cfb748572c26576573715 in linux 5.15.y/5.15.56
e87197fbd137c888fd6c871c72fe7e89445dd015 in mainline linux

sys/dev/pci/drm/i915/gvt/cmd_parser.c

index c4118b8..11971ee 100644 (file)
@@ -3115,9 +3115,9 @@ void intel_gvt_update_reg_whitelist(struct intel_vgpu *vgpu)
                        continue;
 
                vaddr = shmem_pin_map(engine->default_state);
-               if (IS_ERR(vaddr)) {
-                       gvt_err("failed to map %s->default state, err:%zd\n",
-                               engine->name, PTR_ERR(vaddr));
+               if (!vaddr) {
+                       gvt_err("failed to map %s->default state\n",
+                               engine->name);
                        return;
                }