diff options
author | Toomas Soome <tsoome@me.com> | 2019-01-20 13:47:52 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-04-22 08:02:18 +0300 |
commit | f274e1d7606d204f203c8eb43894e5190ba0ff88 (patch) | |
tree | c2066025a05d819e13ef536016b36e1b28006d62 | |
parent | 172f446568dc0e4c9967aa7fc2e0810a0c6beab3 (diff) | |
download | illumos-joyent-f274e1d7606d204f203c8eb43894e5190ba0ff88.tar.gz |
10764 drm: NULL pointer errors
Reviewed by: Sebastian Wiedenroth <sebastian.wiedenroth@skylime.net>
Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r-- | usr/src/uts/common/io/drm/drm_kstat.c | 4 | ||||
-rw-r--r-- | usr/src/uts/common/io/drm/drm_sunmod.c | 28 |
2 files changed, 15 insertions, 17 deletions
diff --git a/usr/src/uts/common/io/drm/drm_kstat.c b/usr/src/uts/common/io/drm/drm_kstat.c index 23e51fe3f2..bc704a2956 100644 --- a/usr/src/uts/common/io/drm/drm_kstat.c +++ b/usr/src/uts/common/io/drm/drm_kstat.c @@ -23,8 +23,6 @@ * All rights reserved. Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "drmP.h" #include <sys/kstat.h> #include <sys/ddi.h> @@ -75,7 +73,7 @@ drm_init_kstats(drm_device_t *sc) KSTAT_TYPE_NAMED, sizeof (drmkstat_name)/sizeof (char *) - 1, KSTAT_FLAG_PERSISTENT); if (ksp == NULL) - return (NULL); + return (0); ksp->ks_private = sc; ksp->ks_update = drm_kstat_update; diff --git a/usr/src/uts/common/io/drm/drm_sunmod.c b/usr/src/uts/common/io/drm/drm_sunmod.c index 8eefdfe101..7347524a0d 100644 --- a/usr/src/uts/common/io/drm/drm_sunmod.c +++ b/usr/src/uts/common/io/drm/drm_sunmod.c @@ -70,32 +70,32 @@ static drm_inst_state_t *drm_sup_devt_to_state(dev_t); static void drm_supp_free_drv_entry(dev_info_t *); static struct devmap_callback_ctl drm_devmap_callbacks = { - DEVMAP_OPS_REV, /* devmap_rev */ - drm_devmap_map, /* devmap_map */ - NULL, /* devmap_access */ + DEVMAP_OPS_REV, /* devmap_rev */ + drm_devmap_map, /* devmap_map */ + NULL, /* devmap_access */ drm_devmap_dup, /* devmap_dup */ - drm_devmap_unmap /* devmap_unmap */ + drm_devmap_unmap /* devmap_unmap */ }; /* * Common device operations structure for all DRM drivers */ struct cb_ops drm_cb_ops = { - drm_sun_open, /* cb_open */ - drm_sun_close, /* cb_close */ + drm_sun_open, /* cb_open */ + drm_sun_close, /* cb_close */ nodev, /* cb_strategy */ nodev, /* cb_print */ nodev, /* cb_dump */ nodev, /* cb_read */ nodev, /* cb_write */ - drm_sun_ioctl, /* cb_ioctl */ - drm_sun_devmap, /* cb_devmap */ + drm_sun_ioctl, /* cb_ioctl */ + drm_sun_devmap, /* cb_devmap */ nodev, /* cb_mmap */ - NULL, /* cb_segmap */ + NULL, /* cb_segmap */ nochpoll, /* cb_chpoll */ - ddi_prop_op, /* cb_prop_op */ + ddi_prop_op, /* cb_prop_op */ 0, /* cb_stream */ - D_NEW | D_MTSAFE |D_DEVMAP /* cb_flag */ + D_NEW | D_MTSAFE |D_DEVMAP /* cb_flag */ }; int @@ -171,7 +171,7 @@ drm_supp_register(dev_info_t *dip, drm_device_t *dp) /* create a minor node for common graphics ops */ (void) sprintf(buf, "%s%d", GFX_NAME, instance); error = ddi_create_minor_node(dip, buf, S_IFCHR, - INST2NODE0(instance), DDI_NT_DISPLAY, NULL); + INST2NODE0(instance), DDI_NT_DISPLAY, 0); if (error != DDI_SUCCESS) { DRM_ERROR("drm_supp_regiter: " "failed to create minor node for gfx"); @@ -766,7 +766,7 @@ drm_devmap_map(devmap_cookie_t dhc, dev_t dev, uint_t flags, { devmap_handle_t *dhp; drm_inst_state_t *statep; - struct ddi_umem_cookie *cp; + struct ddi_umem_cookie *cp; statep = drm_sup_devt_to_state(dev); ASSERT(statep != NULL); @@ -995,7 +995,7 @@ drm_supp_device_capability(void *handle, int capid) /* has capabilities list ? */ if ((pci_config_get16(mstate->mis_cfg_hdl, PCI_CONF_STAT) & PCI_CONF_CAP_MASK) == 0) - return (NULL); + return (0); caps_ptr = pci_config_get8(mstate->mis_cfg_hdl, PCI_CONF_CAP_PTR); while (caps_ptr != PCI_CAP_NEXT_PTR_NULL) { |