From: Greg Kroah-Hartman Date: Mon, 24 Jan 2022 10:04:28 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v4.4.300~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=865d0def853b8e3ee5b7ac91979b0207f74e9a7d;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: drm-radeon-fix-error-handling-in-radeon_driver_open_kms.patch of-base-improve-argument-length-mismatch-error.patch --- diff --git a/queue-5.4/drm-radeon-fix-error-handling-in-radeon_driver_open_kms.patch b/queue-5.4/drm-radeon-fix-error-handling-in-radeon_driver_open_kms.patch new file mode 100644 index 00000000000..48008d6bba7 --- /dev/null +++ b/queue-5.4/drm-radeon-fix-error-handling-in-radeon_driver_open_kms.patch @@ -0,0 +1,89 @@ +From 4722f463896cc0ef1a6f1c3cb2e171e949831249 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20K=C3=B6nig?= +Date: Mon, 17 Jan 2022 10:31:26 +0100 +Subject: drm/radeon: fix error handling in radeon_driver_open_kms +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Christian König + +commit 4722f463896cc0ef1a6f1c3cb2e171e949831249 upstream. + +The return value was never initialized so the cleanup code executed when +it isn't even necessary. + +Just add proper error handling. + +Fixes: ab50cb9df889 ("drm/radeon/radeon_kms: Fix a NULL pointer dereference in radeon_driver_open_kms()") +Signed-off-by: Christian König +Tested-by: Jan Stancek +Tested-by: Borislav Petkov +Reviewed-by: Alex Deucher +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/radeon/radeon_kms.c | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +--- a/drivers/gpu/drm/radeon/radeon_kms.c ++++ b/drivers/gpu/drm/radeon/radeon_kms.c +@@ -652,18 +652,18 @@ int radeon_driver_open_kms(struct drm_de + fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL); + if (unlikely(!fpriv)) { + r = -ENOMEM; +- goto out_suspend; ++ goto err_suspend; + } + + if (rdev->accel_working) { + vm = &fpriv->vm; + r = radeon_vm_init(rdev, vm); + if (r) +- goto out_fpriv; ++ goto err_fpriv; + + r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false); + if (r) +- goto out_vm_fini; ++ goto err_vm_fini; + + /* map the ib pool buffer read only into + * virtual address space */ +@@ -671,7 +671,7 @@ int radeon_driver_open_kms(struct drm_de + rdev->ring_tmp_bo.bo); + if (!vm->ib_bo_va) { + r = -ENOMEM; +- goto out_vm_fini; ++ goto err_vm_fini; + } + + r = radeon_vm_bo_set_addr(rdev, vm->ib_bo_va, +@@ -679,19 +679,21 @@ int radeon_driver_open_kms(struct drm_de + RADEON_VM_PAGE_READABLE | + RADEON_VM_PAGE_SNOOPED); + if (r) +- goto out_vm_fini; ++ goto err_vm_fini; + } + file_priv->driver_priv = fpriv; + } + +- if (!r) +- goto out_suspend; ++ pm_runtime_mark_last_busy(dev->dev); ++ pm_runtime_put_autosuspend(dev->dev); ++ return 0; + +-out_vm_fini: ++err_vm_fini: + radeon_vm_fini(rdev, vm); +-out_fpriv: ++err_fpriv: + kfree(fpriv); +-out_suspend: ++ ++err_suspend: + pm_runtime_mark_last_busy(dev->dev); + pm_runtime_put_autosuspend(dev->dev); + return r; diff --git a/queue-5.4/of-base-improve-argument-length-mismatch-error.patch b/queue-5.4/of-base-improve-argument-length-mismatch-error.patch new file mode 100644 index 00000000000..255154ee41b --- /dev/null +++ b/queue-5.4/of-base-improve-argument-length-mismatch-error.patch @@ -0,0 +1,55 @@ +From 5d05b811b5acb92fc581a7b328b36646c86f5ab9 Mon Sep 17 00:00:00 2001 +From: Baruch Siach +Date: Thu, 30 Dec 2021 18:31:53 +0200 +Subject: of: base: Improve argument length mismatch error + +From: Baruch Siach + +commit 5d05b811b5acb92fc581a7b328b36646c86f5ab9 upstream. + +The cells_name field of of_phandle_iterator might be NULL. Use the +phandle name instead. With this change instead of: + + OF: /soc/pinctrl@1000000: (null) = 3 found 2 + +We get: + + OF: /soc/pinctrl@1000000: phandle pinctrl@1000000 needs 3, found 2 + +Which is a more helpful messages making DT debugging easier. + +In this particular example the phandle name looks like duplicate of the +same node name. But note that the first node is the parent node +(it->parent), while the second is the phandle target (it->node). They +happen to be the same in the case that triggered this improvement. See +commit 72cb4c48a46a ("arm64: dts: qcom: ipq6018: Fix gpio-ranges +property"). + +Signed-off-by: Baruch Siach +Signed-off-by: Rob Herring +Link: https://lore.kernel.org/r/f6a68e0088a552ea9dfd4d8e3b5b586d92594738.1640881913.git.baruch@tkos.co.il +Signed-off-by: Greg Kroah-Hartman +--- + drivers/of/base.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +--- a/drivers/of/base.c ++++ b/drivers/of/base.c +@@ -1366,9 +1366,14 @@ int of_phandle_iterator_next(struct of_p + * property data length + */ + if (it->cur + count > it->list_end) { +- pr_err("%pOF: %s = %d found %td\n", +- it->parent, it->cells_name, +- count, it->list_end - it->cur); ++ if (it->cells_name) ++ pr_err("%pOF: %s = %d found %td\n", ++ it->parent, it->cells_name, ++ count, it->list_end - it->cur); ++ else ++ pr_err("%pOF: phandle %s needs %d, found %td\n", ++ it->parent, of_node_full_name(it->node), ++ count, it->list_end - it->cur); + goto err; + } + } diff --git a/queue-5.4/series b/queue-5.4/series index dfffa7e2a7e..501ab7fc2c2 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -270,3 +270,5 @@ ext4-make-sure-quota-gets-properly-shutdown-on-error.patch ext4-set-csum-seed-in-tmp-inode-while-migrating-to-extents.patch ext4-fix-bug_on-in-ext4_bread-when-write-quota-data.patch ext4-don-t-use-the-orphan-list-when-migrating-an-inode.patch +drm-radeon-fix-error-handling-in-radeon_driver_open_kms.patch +of-base-improve-argument-length-mismatch-error.patch