From 086909ddd0e43e458002ceab54df24430d075fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konsta=20H=C3=B6ltt=C3=A4?= Date: Tue, 22 Feb 2022 12:23:19 +0200 Subject: [PATCH] gpu: nvgpu: use correct err from device_create MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When device_create fails, take PTR_ERR from the subdev that was returned. Commit e8bac374c0ed ("gpu: nvgpu: Use device instead of platform_device") refactored this code but forgot to rename the error retrieval. Change-Id: Id01adac431da77a71c8e71e1b01a065826f5ebcf Signed-off-by: Konsta Hölttä Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2673712 Reviewed-by: Sagar Kamble Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/ioctl.c b/drivers/gpu/nvgpu/os/linux/ioctl.c index 5c5e254dc..cf52de071 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl.c @@ -1,7 +1,7 @@ /* * NVGPU IOCTLs * - * Copyright (c) 2011-2021, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2022, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -282,7 +282,7 @@ static int gk20a_create_device( class->priv_data ? class->priv_data : NULL, device_name ? device_name : cdev_name); if (IS_ERR(subdev)) { - err = PTR_ERR(dev); + err = PTR_ERR(subdev); cdev_del(cdev); dev_err(dev, "failed to create %s device for %s\n", cdev_name, dev_name(dev));