diff mbox series

drm/amdkfd: Fix a && vs || typo

Message ID 20191007085210.GC3865@mwanda (mailing list archive)
State New, archived
Headers show
Series drm/amdkfd: Fix a && vs || typo | expand

Commit Message

Dan Carpenter Oct. 7, 2019, 8:52 a.m. UTC
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 <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alex Deucher Oct. 7, 2019, 4:30 p.m. UTC | #1
On Mon, Oct 7, 2019 at 4:52 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> 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 <dan.carpenter@oracle.com>

Applied.  thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> index 0db273587af4..070c9b5593c9 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> @@ -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
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 0db273587af4..070c9b5593c9 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -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;