firmware: tegra: Changes for v6.1-rc1

A simple cleanup for user memory usage in the BPMP debugfs support.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmMkSrkTHHRyZWRpbmdA
 bnZpZGlhLmNvbQAKCRDdI6zXfz6zoZxQEACVoYjGBWI/DRGa/IIUeq1pSMBRr1ZK
 xEvKhXdmEL6BeqNAaucHLGKIsagkstzNfz8YYm2TvyBUYgycDMsEuF3q0pigXOtV
 BGYrAIZOLggDuiCP4d82bXF2LyEtwF69E2sSMxml8WfF6diJCLRNTqC5HLi4Ek4L
 LjNpPMEU9NZgDP9qJDA+9QGl4b5ngwbJV2wm6OG7ocgdFDYodHnrbgQ49Up1qJ0b
 NYDKXCqDlTAf0+5+D6gTAVF+xofHcYlTsx5Em4KNx5tg5v7pWDo6r4XiVoaGmw4X
 SZXVnEaIpWWPBIfPRAyrYK2QR2ckNNDp9/JCZIkk6By3epfTy6mIFF1H3NBSkLge
 HJjSlTrl8E7R2Vz3/fFOftkniGbCMGOMwPxqClwMofsLuLvFGA5dmRauV6QFjYxp
 RkspqPRJ8VP4Gf9SPIFV90AQL//SLq7Y6uDJRay1usmz6CxOYgOucOAlc+CzJhI5
 oVMI+3Clqbp2sGdzRvpZAbrOjagUIlyG571x++V7FDVTVP/gZWdKBI0Pjck4+NlI
 cekHV4Pfg9MGluGw39UHde9R+fsQFv/p9wfEpdCXL9aJLEYXByA+zrsQG/j2jW/t
 dw6A6DKj9cXlsGkO9wztEJIDre3NVFjty0Y3xWWhlzRXORj2pGqcRaJcg7pTzw9i
 TWkJl80ksrev1Q==
 =MdF0
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmMt0dMACgkQmmx57+YA
 GNktpA//QGTPaoaPmXxK4XceB9BrTFCZ3Kn3+16OR7ir5YgwzKLIqlDMUm6QDRni
 8YcvpbVJDTwX9b6IgLaZ0KsvMiG3HHjCLixh/l0Ti88zuabYwo3qm48kySmAolQ0
 boFbo7snWB8NhSfKcORX8laT1EFf3Aunt99PDS5zbsLPwhjS2LDvT5BmDkOItA83
 lsnyfYiO9blJMO46Xlw/jPKyXwWT9SWfWn4AqllqEUsUGOzQonsQjRHlQMFvXQ6C
 MJEUoXP8zhhdKSf93tfQPJGuMgQWiVLIxZjr6cWEhhfIYIaZn3vPcFSR6/2d/S4l
 URQ8wGVDlkwlcBIhyFGhLODHdpjB0708QCqalHdbOhUi2IZn902PX0C9lW4IyLxw
 wH1nAOcLzafK9QssbU5+0LHWtD2X9CvwPaBeknZzjsWWS1fjNIW0UJHpsYdOBxEf
 LrXVKt6Uq2rAy2a4B6mtMdVpAEbVXCD1g2KtCaTDL9rZbs/QemqMutakvG/6ZJDI
 0rDTT6Ci0UZ9rTZKh5uvh0hB0Qa3iSws0jP/Q+zzniGuvwEcP6Y4LO+WEHVXJTH+
 kUX2I/y2piaJU7xLn7SsrOFm4CJTRivtlig1Ni4uIi4cChk5FI91hTl48ob8DdCJ
 wI53lApk+5LLiUopfF2SEceA4Wy/veJUbTou3NlN4hAlILWlW+A=
 =bx8M
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-6.1-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers

firmware: tegra: Changes for v6.1-rc1

A simple cleanup for user memory usage in the BPMP debugfs support.

* tag 'tegra-for-6.1-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  firmware: tegra: Switch over to memdup_user()

Link: https://lore.kernel.org/r/20220916101957.1635854-3-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2022-09-23 17:33:38 +02:00
commit a30f202fdc

View File

@ -377,18 +377,11 @@ static ssize_t bpmp_debug_store(struct file *file, const char __user *buf,
if (!filename)
return -ENOENT;
databuf = kmalloc(count, GFP_KERNEL);
if (!databuf)
return -ENOMEM;
if (copy_from_user(databuf, buf, count)) {
err = -EFAULT;
goto free_ret;
}
databuf = memdup_user(buf, count);
if (IS_ERR(databuf))
return PTR_ERR(databuf);
err = mrq_debug_write(bpmp, filename, databuf, count);
free_ret:
kfree(databuf);
return err ?: count;