Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'char-misc-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
"Here are two small char/misc driver fixes for 5.17-rc2 that fix some
reported issues. They are:

- fix up a merge issue in the at25.c driver that ended up dropping
some lines in the driver. The removed lines ended being needed, so
this restores it and the driver works again.

- counter core fix where the wrong error was being returned, NULL
should be the correct error for when memory is gone here, like the
kmalloc() core does.

Both of these have been in linux-next this week with no reported
issues"

* tag 'char-misc-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
counter: fix an IS_ERR() vs NULL bug
eeprom: at25: Restore missing allocation

+10 -9
+6 -9
drivers/counter/counter-core.c
··· 90 90 int err; 91 91 92 92 ch = kzalloc(sizeof(*ch) + sizeof_priv, GFP_KERNEL); 93 - if (!ch) { 94 - err = -ENOMEM; 95 - goto err_alloc_ch; 96 - } 93 + if (!ch) 94 + return NULL; 97 95 98 96 counter = &ch->counter; 99 97 dev = &counter->dev; ··· 121 123 err_ida_alloc: 122 124 123 125 kfree(ch); 124 - err_alloc_ch: 125 126 126 - return ERR_PTR(err); 127 + return NULL; 127 128 } 128 129 EXPORT_SYMBOL_GPL(counter_alloc); 129 130 ··· 205 208 int err; 206 209 207 210 counter = counter_alloc(sizeof_priv); 208 - if (IS_ERR(counter)) 209 - return counter; 211 + if (!counter) 212 + return NULL; 210 213 211 214 err = devm_add_action_or_reset(dev, devm_counter_put, counter); 212 215 if (err < 0) 213 - return ERR_PTR(err); 216 + return NULL; 214 217 215 218 return counter; 216 219 }
+4
drivers/misc/eeprom/at25.c
··· 440 440 return -ENXIO; 441 441 } 442 442 443 + at25 = devm_kzalloc(&spi->dev, sizeof(*at25), GFP_KERNEL); 444 + if (!at25) 445 + return -ENOMEM; 446 + 443 447 mutex_init(&at25->lock); 444 448 at25->spi = spi; 445 449 spi_set_drvdata(spi, at25);