]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: dvb_frontend: fix return values for FE_SET_PROPERTY
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 5 Jun 2020 16:25:11 +0000 (09:25 -0700)
committerSasha Levin <sashal@kernel.org>
Tue, 30 Jun 2020 19:38:35 +0000 (15:38 -0400)
commit55089d34f18cfbbcfcb5279b041c1b545ca8e657
tree22dc3291ad917f2aa23993fc0c276119651e85d2
parent79c4efef804f09085fa1ad514960b7ab594df564
media: dvb_frontend: fix return values for FE_SET_PROPERTY

commit 259a41d9ae8f3689742267f340ad2b159d00b302 upstream

There are several problems with regards to the return of
FE_SET_PROPERTY. The original idea were to return per-property
return codes via tvp->result field, and to return an updated
set of values.

However, that never worked. What's actually implemented is:

- the FE_SET_PROPERTY implementation doesn't call .get_frontend
  callback in order to get the actual parameters after return;

- the tvp->result field is only filled if there's no error.
  So, it is always filled with zero;

- FE_SET_PROPERTY doesn't call memdup_user() nor any other
  copy_to_user() function. So, any changes to the properties
  will be lost;

- FE_SET_PROPERTY is declared as a write-only ioctl (IOW).

While we could fix the above, it could cause regressions.

So, let's just assume what the code really does, updating
the documentation accordingly and removing the logic that
would update the discarded tvp->result.

Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/media/uapi/dvb/fe-get-property.rst
drivers/media/dvb-core/dvb_frontend.c
include/uapi/linux/dvb/frontend.h