drm/amdkfd: Fix a && vs || typo
Subsystems (4)
PATCH 1/1 drm/amdkfd: Fix a && vs || typo
In the current code if "device_info" is ever NULL then the kernel will Oops so probably || was intended instead of &&.
Fixes e392c887df97 ("drm/amdkfd: Use array to probe kfd2kgd_calls")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +1 -1
@@ -498,7 +498,7 @@ struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd, device_info = kfd_supported_devices[asic_type][vf]; f2g = kfd2kgd_funcs[asic_type]; -if (!device_info && !f2g) { +if (!device_info || !f2g) {dev_err (kfd_device,"%s %s not supported in kfd\n" , amdgpu_asic_name[asic_type], vf ?"VF" :"" );return NULL ;
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Alex Deucher
AppliedQuoted 6 lines · Dan Carpenter
In the current code if "
device_info" is ever NULL then the kernel will Oops so probably || was intended instead of &&.Fixes e392c887df97 ("drm/amdkfd: Use array to probe kfd2kgd_calls")Signed-off-by Dan Carpenter <[email protected]>
Applied. thanks!
Alex
Quoted 20 lines
--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdkfd/kfd_device.c +1
-2@@ -498,7 +498,7 @@ struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd, device_info = kfd_supported_devices[asic_type][vf]; f2g = kfd2kgd_funcs[asic_type]; -if (!device_info && !f2g) { +if (!device_info || !f2g) {dev_err (kfd_device,"%s %s not supported in kfd\n" , amdgpu_asic_name[asic_type], vf ?"VF" :"" );return NULL ; --2.20.1
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel