Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1214333
| From | Markus Pargmann <mpa@pengutronix.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] regmap: Fix the null function of format_val on regmap_bulk_read. |
| Date | 2015-08-27 07:50 +0200 |
| Message-ID | <q1Yet-3HK-1@gated-at.bofh.it> (permalink) |
| References | <q1Hnj-4Eu-1@gated-at.bofh.it> <q1I9J-5OH-45@gated-at.bofh.it> <q1IW6-6Yn-19@gated-at.bofh.it> <q1MQ2-46E-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Wed, Aug 26, 2015 at 06:38:12PM +0100, Mark Brown wrote: > On Wed, Aug 26, 2015 at 03:22:46PM +0200, Markus Pargmann wrote: > > On Wed, Aug 26, 2015 at 01:35:56PM +0100, Mark Brown wrote: > > > On Wed, Aug 26, 2015 at 07:43:16PM +0800, Henry Chen wrote: > > > > Why are these format functions sensible? Converting a null pointer > > > dereference into data corruption wouldn't be ideal. The commit message > > > should really cover this. > > > The regmap_bulk_read() function worked before the following patch: > > 15b8d2c41fe5 (regmap: Fix regmap_bulk_read in BE mode) > > Define "worked" here. "worked" means here that it did not run into a null pointer and returned something that the user expected. I am not sure if someone actually complained about the previous use of memcpy? I also don't know how the behavior of regmap_bulk_read with reg_read() is defined. Best Regards, Markus > > > As far as I can see this patch fixes this issue by using simple format > > functions. Before the above mentioned patch, the code used memcpy. Now > > regmap_format_*_native is used which should result in the same behaviour > > but fixes the null pointer. > > Again, this sort of analysis needs to be in the commit message (and > really ought to explain why the resulting API makes sense). > > > I am not sure if there are other locations in the code where format_val > > is used in this setup so I don't know if this would change behavior in a > > different codepath. > > Which is another part of the concern, being able to format values is a > more general concept. -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] regmap: Fix the null function of format_val on regmap_bulk_read. Henry Chen <henryc.chen@mediatek.com> - 2015-08-26 13:50 +0200
Re: [PATCH] regmap: Fix the null function of format_val on regmap_bulk_read. Mark Brown <broonie@kernel.org> - 2015-08-26 14:40 +0200
Re: [PATCH] regmap: Fix the null function of format_val on regmap_bulk_read. Markus Pargmann <mpa@pengutronix.de> - 2015-08-26 15:30 +0200
Re: [PATCH] regmap: Fix the null function of format_val on regmap_bulk_read. Mark Brown <broonie@kernel.org> - 2015-08-26 19:40 +0200
Re: [PATCH] regmap: Fix the null function of format_val on regmap_bulk_read. Markus Pargmann <mpa@pengutronix.de> - 2015-08-27 07:50 +0200
Re: [PATCH] regmap: Fix the null function of format_val on regmap_bulk_read. Mark Brown <broonie@kernel.org> - 2015-08-27 12:10 +0200
csiph-web