Project

General

Profile

Actions

Bug #12645

closed

vds: smatch and NULL pointer errors

Added by Toomas Soome about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors on SPARC with NULL pointers:

    ../../sun4v/io/vds.c: In function 'vd_flush_write':
    ../../sun4v/io/vds.c:1900: error: passing argument 3 of 'ldi_ioctl' makes integer from pointer without a cast
    ../../common/sys/sunldi.h:109: note: expected 'intptr_t' but argument is of type 'void *'
    ../../sun4v/io/vds.c: In function 'vd_get_access':
    ../../sun4v/io/vds.c:3893: error: passing argument 3 of 'ldi_ioctl' makes integer from pointer without a cast
    ../../common/sys/sunldi.h:109: note: expected 'intptr_t' but argument is of type 'void *'
    ../../sun4v/io/vds.c: In function 'vd_set_access':
    ../../sun4v/io/vds.c:3939: error: passing argument 3 of 'ldi_ioctl' makes integer from pointer without a cast
    ../../common/sys/sunldi.h:109: note: expected 'intptr_t' but argument is of type 'void *'
    ../../sun4v/io/vds.c:3965: error: passing argument 3 of 'ldi_ioctl' makes integer from pointer without a cast
    ../../common/sys/sunldi.h:109: note: expected 'intptr_t' but argument is of type 'void *'
    ../../sun4v/io/vds.c:3981: error: passing argument 3 of 'ldi_ioctl' makes integer from pointer without a cast
    ../../common/sys/sunldi.h:109: note: expected 'intptr_t' but argument is of type 'void *'
    ../../sun4v/io/vds.c:3985: error: passing argument 3 of 'ldi_ioctl' makes integer from pointer without a cast
    ../../common/sys/sunldi.h:109: note: expected 'intptr_t' but argument is of type 'void *'
    ../../sun4v/io/vds.c:3998: error: passing argument 3 of 'ldi_ioctl' makes integer from pointer without a cast
    ../../common/sys/sunldi.h:109: note: expected 'intptr_t' but argument is of type 'void *'
    ../../sun4v/io/vds.c:4008: error: passing argument 3 of 'ldi_ioctl' makes integer from pointer without a cast
    ../../common/sys/sunldi.h:109: note: expected 'intptr_t' but argument is of type 'void *'
    ../../sun4v/io/vds.c:4016: error: passing argument 3 of 'ldi_ioctl' makes integer from pointer without a cast
    ../../common/sys/sunldi.h:109: note: expected 'intptr_t' but argument is of type 'void *'
    ../../sun4v/io/vds.c: In function 'vd_reset_access':
    ../../sun4v/io/vds.c:4038: error: passing argument 3 of 'ldi_ioctl' makes integer from pointer without a cast
    ../../common/sys/sunldi.h:109: note: expected 'intptr_t' but argument is of type 'void *'
    ../../sun4v/io/vds.c:4063: error: passing argument 3 of 'ldi_ioctl' makes integer from pointer without a cast
    ../../common/sys/sunldi.h:109: note: expected 'intptr_t' but argument is of type 'void *'
    ../../sun4v/io/vds.c:4084: error: passing argument 3 of 'uadmin' makes integer from pointer without a cast
    ../../common/sys/uadmin.h:165: note: expected 'uintptr_t' but argument is of type 'void *'
    ../../sun4v/io/vds.c: In function 'vds_detach':
    ../../sun4v/io/vds.c:5418: error: assignment makes integer from pointer without a cast
    ../../sun4v/io/vds.c: In function 'vd_setup_disk_image':
    ../../sun4v/io/vds.c:6063: error: passing argument 3 of 'ddi_devid_init' makes integer from pointer without a cast
    ../../common/sys/sunddi.h:2063: note: expected 'ushort_t' but argument is of type 'void *'
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../sun4v/io/vds.c:3693 vd_ioctl() error: buffer overflow 'ioctl' 10 <= 10 (assuming for loop doesn't break)

Actions #1

Updated by Electric Monk about 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit b939b187ee16d21b506005807c652e2c7bdfe243

commit  b939b187ee16d21b506005807c652e2c7bdfe243
Author: Toomas Soome <tsoome@me.com>
Date:   2020-05-11T20:43:44.000Z

    12645 vds: smatch and NULL pointer errors
    Reviewed by: Jorge Schrauwen <registration@blackdot.be>
    Reviewed by: John Levon <john.levon@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF