forked from Imagelibrary/rtems
leon,grtm: ioctl() shouldn't access pointer before validated
This is a fix for a coverity warning
This commit is contained in:
@@ -1188,7 +1188,7 @@ static rtems_device_driver grtm_ioctl(rtems_device_major_number major, rtems_dev
|
|||||||
struct grtm_priv *pDev;
|
struct grtm_priv *pDev;
|
||||||
struct drvmgr_dev *dev;
|
struct drvmgr_dev *dev;
|
||||||
rtems_libio_ioctl_args_t *ioarg = (rtems_libio_ioctl_args_t *)arg;
|
rtems_libio_ioctl_args_t *ioarg = (rtems_libio_ioctl_args_t *)arg;
|
||||||
unsigned int *data = ioarg->buffer;
|
unsigned int *data;
|
||||||
int status;
|
int status;
|
||||||
struct grtm_ioc_config *cfg;
|
struct grtm_ioc_config *cfg;
|
||||||
struct grtm_ioc_hw_status *hwregs;
|
struct grtm_ioc_hw_status *hwregs;
|
||||||
@@ -1209,6 +1209,7 @@ static rtems_device_driver grtm_ioctl(rtems_device_major_number major, rtems_dev
|
|||||||
if (!ioarg)
|
if (!ioarg)
|
||||||
return RTEMS_INVALID_NAME;
|
return RTEMS_INVALID_NAME;
|
||||||
|
|
||||||
|
data = ioarg->buffer;
|
||||||
ioarg->ioctl_return = 0;
|
ioarg->ioctl_return = 0;
|
||||||
switch(ioarg->command) {
|
switch(ioarg->command) {
|
||||||
case GRTM_IOC_START:
|
case GRTM_IOC_START:
|
||||||
|
|||||||
Reference in New Issue
Block a user