Re: [PATCH] char: ppdev: fixed a validation issue

From: Vihas Mak
Date: Tue Nov 09 2021 - 12:51:53 EST


> And you didn't answer my question above, what happens if the mode is not
> set properly today?

It'll throw a ENOSYS if the mode is not set properly and print the following:

pr_debug("%s: Unknown mode 0x%02x\n",
port->name, port->ieee1284.mode);


On Tue, Nov 9, 2021 at 9:11 PM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Nov 09, 2021 at 09:04:57PM +0530, Vihas Mak wrote:
> > > What happens today if the mode is not set properly? Will the code paths
> > > error out eventually, or will the call succeed? The problem is that
> > > there might be code that is working today that would break with a change
> > > like this, as again, this is a very old driver.
> >
> > I see. So I guess this driver might be better off without any changes,
> > as new changes might break things more severely.
>
> Changes in behavior always have the ability to break things. What other
> changes do you want to make to this old driver that might cause
> problems?
>
> And you didn't answer my question above, what happens if the mode is not
> set properly today?
>
> thanks,
>
> greg k-h