<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/char/ppdev.c, branch v4.10-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>ppdev: check before attaching port</title>
<updated>2016-11-29T19:25:34+00:00</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-11-12T21:22:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=dd5c472a60e43549d789a17a8444513eec64bd7e'/>
<id>dd5c472a60e43549d789a17a8444513eec64bd7e</id>
<content type='text'>
After parport starts using the device model, all pardevice drivers
should decide in their match_port callback function if they want to
attach with that particulatr port. ppdev has been converted to use the
new parport device-model code but pp_attach() tried to attach with all
the ports.
Create a new array of pointer and use that to remember the ports we
have attached. And use that information to skip attaching ports which
we have already attached.

Tested-by: Joe Lawrence &lt;joe.lawrence@redhat.com&gt;
Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After parport starts using the device model, all pardevice drivers
should decide in their match_port callback function if they want to
attach with that particulatr port. ppdev has been converted to use the
new parport device-model code but pp_attach() tried to attach with all
the ports.
Create a new array of pointer and use that to remember the ports we
have attached. And use that information to skip attaching ports which
we have already attached.

Tested-by: Joe Lawrence &lt;joe.lawrence@redhat.com&gt;
Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ppdev: use pr_* macros</title>
<updated>2016-11-29T19:25:34+00:00</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-11-10T22:12:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=826a4c6574efafdcfc292cdaf4dd2ccd6133d5f0'/>
<id>826a4c6574efafdcfc292cdaf4dd2ccd6133d5f0</id>
<content type='text'>
The coding style recommends not to use printk. Use pr_* macros.

Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The coding style recommends not to use printk. Use pr_* macros.

Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ppdev: fix memory leak</title>
<updated>2016-11-29T19:25:34+00:00</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-11-10T22:11:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2bd362d5f45c17f3a41b3ab04e71508ffd3f48c5'/>
<id>2bd362d5f45c17f3a41b3ab04e71508ffd3f48c5</id>
<content type='text'>
The variable name was only released if parport_register_dev_model()
fails. Now that we are using the device-model the parport driver
will duplicate the name and use it. So we can release the variable
after the device has been registered with the parport.

Suggested-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The variable name was only released if parport_register_dev_model()
fails. Now that we are using the device-model the parport driver
will duplicate the name and use it. So we can release the variable
after the device has been registered with the parport.

Suggested-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ppdev: fix double-free of pp-&gt;pdev-&gt;name</title>
<updated>2016-11-10T14:24:02+00:00</updated>
<author>
<name>Jann Horn</name>
<email>jann@thejh.net</email>
</author>
<published>2016-10-30T22:19:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b13d14339baaaa720e7e5448855f33ba501917aa'/>
<id>b13d14339baaaa720e7e5448855f33ba501917aa</id>
<content type='text'>
free_pardevice() is called by parport_unregister_device() and already frees
pp-&gt;pdev-&gt;name, don't try to do it again.

This bug causes kernel crashes.

I found and verified this with KASAN and some added pr_emerg()s:

[   60.316568] pp_release: pp-&gt;pdev-&gt;name == ffff88039cb264c0
[   60.316692] free_pardevice: freeing par_dev-&gt;name at ffff88039cb264c0
[   60.316706] pp_release: kfree(ffff88039cb264c0)
[   60.316714] ==========================================================
[   60.316722] BUG: Double free or freeing an invalid pointer
[   60.316731] Unexpected shadow byte: 0xFB
[   60.316801] Object at ffff88039cb264c0, in cache kmalloc-32 size: 32
[   60.316813] Allocated:
[   60.316824] PID = 1695
[   60.316869] Freed:
[   60.316880] PID = 1695
[   60.316935] ==========================================================

Signed-off-by: Jann Horn &lt;jann@thejh.net&gt;
Acked-by: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
free_pardevice() is called by parport_unregister_device() and already frees
pp-&gt;pdev-&gt;name, don't try to do it again.

This bug causes kernel crashes.

I found and verified this with KASAN and some added pr_emerg()s:

[   60.316568] pp_release: pp-&gt;pdev-&gt;name == ffff88039cb264c0
[   60.316692] free_pardevice: freeing par_dev-&gt;name at ffff88039cb264c0
[   60.316706] pp_release: kfree(ffff88039cb264c0)
[   60.316714] ==========================================================
[   60.316722] BUG: Double free or freeing an invalid pointer
[   60.316731] Unexpected shadow byte: 0xFB
[   60.316801] Object at ffff88039cb264c0, in cache kmalloc-32 size: 32
[   60.316813] Allocated:
[   60.316824] PID = 1695
[   60.316869] Freed:
[   60.316880] PID = 1695
[   60.316935] ==========================================================

Signed-off-by: Jann Horn &lt;jann@thejh.net&gt;
Acked-by: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ppdev: use new parport device model</title>
<updated>2016-08-31T12:22:49+00:00</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-06-01T12:20:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8b7d3a9d903ee1d1f5febc8e74223e4e72720e35'/>
<id>8b7d3a9d903ee1d1f5febc8e74223e4e72720e35</id>
<content type='text'>
Modify ppdev driver to use the new parallel port device model.

Initially submitted and committed as:
e7223f186033 ("ppdev: use new parport device model")

But due to some regression it was reverted by:
1701f680407c ("Revert "ppdev: use new parport device model"")

Now that the original source of regression is fixed by:
bbca503b2ee0 ("parport: use subsys_initcall") we can again modify ppdev
to use device model.

Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modify ppdev driver to use the new parallel port device model.

Initially submitted and committed as:
e7223f186033 ("ppdev: use new parport device model")

But due to some regression it was reverted by:
1701f680407c ("Revert "ppdev: use new parport device model"")

Now that the original source of regression is fixed by:
bbca503b2ee0 ("parport: use subsys_initcall") we can again modify ppdev
to use device model.

Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "ppdev: use new parport device model"</title>
<updated>2016-03-25T16:02:13+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-03-25T16:02:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1701f680407c6cc05121566cef5293d33881fe71'/>
<id>1701f680407c6cc05121566cef5293d33881fe71</id>
<content type='text'>
This reverts commit e7223f18603374d235d8bb0398532323e5f318b9.

It causes problems when a ppdev tries to register before the parport
driver has been registered with the device model. That will trigger the

        BUG_ON(!drv-&gt;bus-&gt;p);

at drivers/base/driver.c:153. The call chain is

  kernel_init -&gt;
    kernel_init_freeable -&gt;
      do_one_initcall -&gt;
        ppdev_init -&gt;
          __parport_register_driver -&gt;
            driver_register *BOOM*

Reported-by: kernel test robot &lt;fengguang.wu@intel.com&gt;
Reported-by: Ross Zwisler &lt;zwisler@gmail.com&gt;
Reported-by: Petr Mladek &lt;pmladek@suse.com&gt;
Cc: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit e7223f18603374d235d8bb0398532323e5f318b9.

It causes problems when a ppdev tries to register before the parport
driver has been registered with the device model. That will trigger the

        BUG_ON(!drv-&gt;bus-&gt;p);

at drivers/base/driver.c:153. The call chain is

  kernel_init -&gt;
    kernel_init_freeable -&gt;
      do_one_initcall -&gt;
        ppdev_init -&gt;
          __parport_register_driver -&gt;
            driver_register *BOOM*

Reported-by: kernel test robot &lt;fengguang.wu@intel.com&gt;
Reported-by: Ross Zwisler &lt;zwisler@gmail.com&gt;
Reported-by: Petr Mladek &lt;pmladek@suse.com&gt;
Cc: Sudip Mukherjee &lt;sudipm.mukherjee@gmail.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ppdev: use dev_* macros</title>
<updated>2016-02-15T01:43:50+00:00</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-02-12T13:03:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=396ec3dea3d82d0a32906efe9803a8ef2647df51'/>
<id>396ec3dea3d82d0a32906efe9803a8ef2647df51</id>
<content type='text'>
It is more preffered to use the dev_* family of macros instead of using
the generic pr_*.

Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is more preffered to use the dev_* family of macros instead of using
the generic pr_*.

Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ppdev: use new parport device model</title>
<updated>2016-02-15T01:43:50+00:00</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-02-12T13:03:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e7223f18603374d235d8bb0398532323e5f318b9'/>
<id>e7223f18603374d235d8bb0398532323e5f318b9</id>
<content type='text'>
Modify ppdev driver to use the new parallel port device model.

Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modify ppdev driver to use the new parallel port device model.

Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ppdev: remove space before tab</title>
<updated>2016-02-15T01:43:50+00:00</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-02-12T13:03:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3c8db584323875a50696718c89d94cef0ed54f30'/>
<id>3c8db584323875a50696718c89d94cef0ed54f30</id>
<content type='text'>
For alignment we should use tab in all possible places.
checkpatch was complaining for using space before tab.

Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For alignment we should use tab in all possible places.
checkpatch was complaining for using space before tab.

Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ppdev: fix parenthesis alignment</title>
<updated>2016-02-15T01:43:50+00:00</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-02-12T13:03:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a7c71c07a31fde429627f0c7eed5fb57cb986fa6'/>
<id>a7c71c07a31fde429627f0c7eed5fb57cb986fa6</id>
<content type='text'>
checkpatch was complaining that the alignment was not matching with the
open parenthesis.

Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
checkpatch was complaining that the alignment was not matching with the
open parenthesis.

Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
