lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 27 Oct 2023 14:36:00 +0100
From:   Jonathan Cameron <jic23@...nel.org>
To:     Su Hui <suhui@...china.com>
Cc:     Jonathan Cameron <Jonathan.Cameron@...wei.com>, lars@...afoo.de,
        jean-baptiste.maneyrol@....com, chenhuiz@...s.com,
        andy.shevchenko@...il.com, linux-iio@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 2/2] phy: mapphone-mdm6600: fix an error code problem in
 inv_mpu6050_read_raw

On Mon, 23 Oct 2023 11:29:30 +0800
Su Hui <suhui@...china.com> wrote:

> On 2023/10/23 09:33, Su Hui wrote:
> > On 2023/10/20 23:55, Jonathan Cameron wrote:  
> >> I'm not sure why inv_mpu6050_sensor_show() doesn't return
> >> the actual error code from the regmap_bulk_read() and instead 
> >> replaces it
> >> with -EINVAL.  Given you are tidying up this related issues perhaps 
> >> change
> >> that as well?
> >>
> >> static int inv_mpu6050_sensor_show(struct inv_mpu6050_state *st, int 
> >> reg,
> >>                    int axis, int *val)
> >> {
> >>     int ind, result;
> >>     __be16 d;
> >>
> >>     ind = (axis - IIO_MOD_X) * 2;
> >>     result = regmap_bulk_read(st->map, reg + ind, &d, sizeof(d));
> >>     if (result)
> >>         return -EINVAL;
> >> //Make this return result;  
> >
> > Sure, I will tidy up this, Thanks for your suggestion!  
> 
> I'm not sure  whether the caller could handler this  when return 
> 'result' rather than '-EINVAL'.
> 
> This is not a big problem, maybe we shouldn't modify this code.

If the ultimate caller (userspace in this case) doesn't handle other
error codes it won't work with lots of other devices and is broken.

So I doubt any code is that fragile. If we get a report of a regression
we can look into whether it's sensible to resolve it.

So fine to change this, but could be a separate patch.

J
> 
> Su Hui
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ