Search

Technical Discussion Group Forum

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

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

To receive email notifications when updates are posted for a Logic PD 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  mfonseca@keywcorp.com
null pointer exceptions in logicpd-new-productid.c
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages
mfonseca@keywcorp.com
New Member
New Member
Posts:15


--
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");
         else{
             fs = get_fs();
    @@ -1437,9 +1436,10 @@
             sz = hdr.data_length;
             vfs_read(f, (void *)&id_data_buf[sizeof(hdr) + sizeof(xsums)], sz, &pos);
             set_fs(fs);
    -    }
         filp_close(f,NULL);
    -    return ret;
    +        return 0;
    +    }
    +    return -1;
     }
     #endif
     

    adam.ford@logicpd.com
    Advanced Member
    Advanced Member
    Posts:783


    --
    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,

    adam
    mfonseca@keywcorp.com
    New Member
    New Member
    Posts:15


    --
    30 May 2018 11:51 AM

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

    mfonseca@keywcorp.com
    New Member
    New Member
    Posts:15


    --
    30 May 2018 11:52 AM

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

    You are not authorized to post a reply.