Daniel Mack
a4e3f91b98
ds2760_battery.c: fix division by zero
The 'battery remaining capacity' calculation in
drivers/power/ds2760_battery.c lacks a parameter check to a division
operation which causes the kernel to oops on my board.
[ 21.233750] Division by zero in kernel.
[ 21.237646] [<c002955c>] (__div0+0x0/0x20) from [<c012561c>] (Ldiv0+0x8/0x10)
[ 21.244816] [<c01bef34>] (ds2760_battery_read_status+0x0/0x2a4) from [<c01bf3a4>] (ds2760_battery_get_property+0x30/0xdc)
[ 21.255803] r8:c03a22c0 r7:c7886100 r6:00000009 r5:c782fe7c r4:c7886084
[ 21.262518] [<c01bf374>] (ds2760_battery_get_property+0x0/0xdc) from [<c01bde98>] (power_supply_show_property+0x48/0x114)
[ 21.273480] r6:c7996000 r5:00000009 r4:00000000
[ 21.278111] [<c01bde50>] (power_supply_show_property+0x0/0x114) from [<c01be158>] (power_supply_uevent+0x188/0x280)
[ 21.288537] r8:00000001 r7:c7886100 r6:c7996000 r5:000000b4 r4:00000000
[ 21.295222] [<c01bdfd0>] (power_supply_uevent+0x0/0x280) from [<c015c664>] (dev_uevent+0xd4/0x10c)
[ 21.304199] [<c015c590>] (dev_uevent+0x0/0x10c) from [<c0128440>] (kobject_uevent_env+0x180/0x390)
[ 21.313170] r5:00000000 r4:c78860ac
[ 21.316725] [<c01282c0>] (kobject_uevent_env+0x0/0x390) from [<c0128664>] (kobject_uevent+0x14/0x18)
[ 21.325850] [<c0128650>] (kobject_uevent+0x0/0x18) from [<c01bdc34>] (power_supply_changed_work+0x5c/0x70)
[ 21.335506] [<c01bdbd8>] (power_supply_changed_work+0x0/0x70) from [<c004d290>] (run_workqueue+0xbc/0x144)
[ 21.345167] r4:c7812040
[ 21.347716] [<c004d1d4>] (run_workqueue+0x0/0x144) from [<c004d94c>] (worker_thread+0xa8/0xbc)
[ 21.356296] r7:c7812040 r6:c7820b00 r5:c782ffa4 r4:c7812048
[ 21.361957] [<c004d8a4>] (worker_thread+0x0/0xbc) from [<c0051008>] (kthread+0x5c/0x94)
[ 21.369971] r7:00000000 r6:c004d8a4 r5:c7812040 r4:c782e000
[ 21.375612] [<c0050fac>] (kthread+0x0/0x94) from [<c00403d0>] (do_exit+0x0/0x688)
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Szabolcs Gyurko <szabolcs.gyurko@tlt.hu>
Acked-by: Matt Reimer <mreimer@vpop.net>
Acked-by: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-03-12 16:20:23 -07:00
..
2009-02-21 22:01:43 -05:00
2009-01-08 16:29:41 +00:00
2009-03-05 07:26:10 -05:00
2009-02-18 17:41:38 -08:00
2009-03-10 15:55:10 -07:00
2009-03-09 09:15:40 -07:00
2009-03-11 12:14:04 -07:00
2009-03-09 15:07:33 -04:00
2009-03-04 08:01:22 +08:00
2009-03-04 16:04:40 -07:00
2009-01-12 20:56:42 +01:00
2009-03-08 10:23:05 -07:00
2009-01-28 17:15:52 +11:00
2009-02-01 11:17:24 +01:00
2009-02-18 15:37:56 -08:00
2009-01-29 18:04:43 -08:00
2009-03-11 11:02:06 -07:00
2009-02-17 13:25:01 +01:00
2009-03-10 15:55:10 -07:00
2009-03-03 14:12:41 -08:00
2009-03-05 16:10:58 +01:00
2009-02-26 10:32:31 -08:00
2009-01-16 15:05:54 -08:00
2009-03-02 15:43:03 -08:00
2009-02-20 00:54:44 -08:00
2009-01-15 16:39:40 -08:00
2009-03-09 10:06:29 +10:30
2009-01-07 11:31:52 -08:00
2009-03-04 00:57:25 -07:00
2009-03-02 15:43:03 -08:00
2009-01-09 16:54:41 -08:00
2009-02-22 08:51:07 -06:00
2009-02-17 09:48:05 +01:00
2009-02-27 16:26:22 -08:00
2009-03-08 14:46:04 +01:00
2009-03-10 15:55:11 -07:00
2009-03-12 09:27:53 -07:00
2009-01-09 15:49:06 -07:00
2009-01-17 17:26:39 +01:00
2009-01-29 18:19:29 -08:00
2009-02-22 09:23:02 -08:00
2009-02-26 14:43:42 -08:00
2009-01-13 14:47:59 +11:00
2009-02-21 21:59:55 -05:00
2009-01-09 03:39:43 -05:00
2009-03-12 16:20:23 -07:00
2009-01-16 16:15:14 +11:00
2009-01-30 21:50:49 +00:00
2009-02-11 14:25:36 -08:00
2009-02-19 15:19:19 +01:00
2009-03-04 00:19:28 -08:00
2009-02-21 20:29:38 -06:00
2009-02-27 16:40:00 -08:00
2009-02-18 15:37:56 -08:00
2009-02-27 12:56:24 -08:00
2009-02-27 14:40:51 -08:00
2009-01-23 12:57:20 +00:00
2009-03-11 12:14:04 -07:00
2009-02-02 19:17:56 -08:00
2009-03-12 16:20:23 -07:00
2009-03-05 19:25:05 +00:00
2009-02-22 10:33:44 -08:00
2009-01-12 20:56:43 +01:00
2009-01-09 04:56:56 -05:00