Coverity-updates archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

New Defects reported by Coverity Scan for NetBSD-i386-kernel



Hi,


Please find the latest report on new defect(s) introduced to NetBSD-i386-kernel 
found with Coverity Scan.

Defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)


** CID 1193194:  Operands don't affect result  (CONSTANT_EXPRESSION_RESULT)
/sys/dev/usb/uslsa.c: 408 in uslsa_param()

** CID 1193195:  Extra sizeof expression  (SIZEOF_MISMATCH)
/sys/kern/subr_vmem.c: 326 in bt_freetrim()


________________________________________________________________________________________________________
*** CID 1193194:  Operands don't affect result  (CONSTANT_EXPRESSION_RESULT)
/sys/dev/usb/uslsa.c: 408 in uslsa_param()
402                     return EIO;
403             }
404     
405             req.bmRequestType = UT_WRITE_VENDOR_INTERFACE;
406             req.bRequest = SLSA_R_SET_BAUDRATE;
407             USETW(req.wValue, 0);
>>>     CID 1193194:  Operands don't affect result  (CONSTANT_EXPRESSION_RESULT)
>>>     "sc->sc_ifnum >> 8" is 0 regardless of the values of its operands. This 
>>> occurs as the operand of assignment.
408             USETW(req.wIndex, sc->sc_ifnum);
409             USETW(req.wLength, 4);
410     
411             baud = t->c_ospeed;
412             status = usbd_do_request(sc->sc_udev, &req, &baud);
413             if (status != USBD_NORMAL_COMPLETION) {

________________________________________________________________________________________________________
*** CID 1193195:  Extra sizeof expression  (SIZEOF_MISMATCH)
/sys/kern/subr_vmem.c: 326 in bt_freetrim()
320     
321             VMEM_LOCK(vm);
322             while (vm->vm_nfreetags > freelimit) {
323                     bt_t *bt = LIST_FIRST(&vm->vm_freetags);
324                     LIST_REMOVE(bt, bt_freelist);
325                     vm->vm_nfreetags--;
>>>     CID 1193195:  Extra sizeof expression  (SIZEOF_MISMATCH)
>>>     Adding "5600U /* sizeof (static_bts) */" to pointer "static_bts" of 
>>> type "struct vmem_btag [200]" is suspicious because adding an integral 
>>> value to this pointer automatically scales that value by the size, 28 
>>> bytes, of the pointed-to type, "struct vmem_btag".  Most likely, you 
>>> intended to use the number of elements in "static_bts" rather than its size 
>>> in bytes.
326                     if (bt >= static_bts
327                         && bt < static_bts + sizeof(static_bts)) {
328                             mutex_enter(&vmem_btag_lock);
329                             LIST_INSERT_HEAD(&vmem_btag_freelist, bt, 
bt_freelist);
330                             vmem_btag_freelist_count++;
331                             mutex_exit(&vmem_btag_lock);


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, 
http://scan.coverity.com/projects/1450?tab=Overview

To unsubscribe from the email notification for new defects, 
http://scan5.coverity.com/cgi-bin/unsubscribe.py




Home | Main Index | Thread Index | Old Index