Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 30 May 2018 11:52 AM by  Marco Fonseca
null pointer exceptions in logicpd-new-productid.c
 3 Replies
You are not authorized to post a reply.
Author Messages

Marco Fonseca

New Member

New Member

23 May 2018 04:51 PM

    Not sure where to report bugs, here as good as any other?

    The error path causes null pointer exceptions.  Something like below is needed.

    --- a/logicpd-new-productid.c   2018-05-23 17:38:32.678514618 -0400                                                                           
    +++ b/logicpd-new-productid.c   2018-05-23 16:42:17.607646256 -0400                                                                           
    @@ -1399,7 +1399,6 @@
         struct file *f;
         mm_segment_t fs;
         loff_t pos = 0;
    -    int ret = 0;
         long sz;
         struct id_header hdr;
    @@ -1407,7 +1406,7 @@
         f = filp_open(EEPROM_PATH, O_RDONLY, 0);
    -    if(f == NULL)
    +    if(IS_ERR(f))
             printk(KERN_ALERT "filp_open error!!.\n");
             fs = get_fs();
    @@ -1437,9 +1436,10 @@
             sz = hdr.data_length;
             vfs_read(f, (void *)&id_data_buf[sizeof(hdr) + sizeof(xsums)], sz, &pos);
    -    }
    -    return ret;
    +        return 0;
    +    }
    +    return -1;

    Adam Ford

    Advanced Member

    Advanced Member

    29 May 2018 07:26 AM
    Thank you for the patch.

    Can you tell me which BSP your patch is fixing? I'd like to enter it into our bug tracking system for review.

    thank you,


    Marco Fonseca

    New Member

    New Member

    30 May 2018 11:51 AM

    Its a patch to a patch.  I got the origial patch from (which contains the patches/0001-Create-LPD-4.9.y-BSP.patch) file.

    Marco Fonseca

    New Member

    New Member

    30 May 2018 11:52 AM

    Rather,  a patch to a file generated from the patch.

    You are not authorized to post a reply.