Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Division by zero in kernel!

    Hi, guys
    I write a driver for camera ov9655 based-s3c2440. When I test the driver, the system show me division by zero in kernel and the test routine is blocked! what can I do someting with this bug.

    The following image is the information that the systme show me:
    Division by zero in kernel.
    [<c00331cc>] (dump_backtrace+0x0/0x10c) from [<c0326c68>] (dump_stack+0x18/0x1c)
    r7:00000000 r6:00000000 r5:c5200000 r4:80000000
    [<c0326c50>] (dump_stack+0x0/0x1c) from [<c0033924>] (__div0+0x18/0x20)
    [<c003390c>] (__div0+0x0/0x20) from [<c0142f58>] (Ldiv0+0x8/0x10)
    [<bf000c54>] (camif_open+0x0/0x694 [camera_driver]) from [<c016ad64>] (misc_open+0x158/0x20
    [<c016ac0c>] (misc_open+0x0/0x20 from [<c009ccf4>] (chrdev_open+0xd0/0x160)
    r9:00000001 r8:c009cc24 r7:00000000 r6:c383de80 r5:c3afc800

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    All this debug info is useless! Please post kernel drive code here. If you are dividing by a variable value, test the variable for 0 before you try to do the divide. Also, you cannot do floating point math in the kernel - integer math only. So, if you are doing a divide in a kernel module, try a left shift operation instead!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts