Module Name: src Committed By: oster Date: Wed Feb 6 03:37:13 UTC 2019
Modified Files: src/sys/dev/raidframe: rf_netbsdkintf.c Log Message: Fix GET_INFO. Yes, can probably be simplified. To generate a diff of this commit: cvs rdiff -u -r1.370 -r1.371 src/sys/dev/raidframe/rf_netbsdkintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/raidframe/rf_netbsdkintf.c diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.370 src/sys/dev/raidframe/rf_netbsdkintf.c:1.371 --- src/sys/dev/raidframe/rf_netbsdkintf.c:1.370 Wed Feb 6 03:01:48 2019 +++ src/sys/dev/raidframe/rf_netbsdkintf.c Wed Feb 6 03:37:13 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.370 2019/02/06 03:01:48 christos Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.371 2019/02/06 03:37:13 oster Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ ***********************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.370 2019/02/06 03:01:48 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.371 2019/02/06 03:37:13 oster Exp $"); #ifdef _KERNEL_OPT #include "opt_raid_autoconfig.h" @@ -1399,7 +1399,7 @@ raidioctl(dev_t dev, u_long cmd, void *d RF_Raid_t *raidPtr; RF_AccTotals_t *totals; RF_SingleComponent_t component; - RF_DeviceConfig_t *d_cfg; + RF_DeviceConfig_t *d_cfg, *ucfgp; int retcode = 0; int column; RF_ComponentLabel_t *clabel; @@ -1513,13 +1513,14 @@ raidioctl(dev_t dev, u_long cmd, void *d return rf_rebuild_in_place(raidPtr, data); case RAIDFRAME_GET_INFO: + ucfgp = *(RF_DeviceConfig_t **)data; RF_Malloc(d_cfg, sizeof(RF_DeviceConfig_t), (RF_DeviceConfig_t *)); if (d_cfg == NULL) return ENOMEM; retcode = rf_get_info(raidPtr, d_cfg); if (retcode == 0) { - retcode = copyout(d_cfg, data, sizeof(*d_cfg)); + retcode = copyout(d_cfg, ucfgp, sizeof(*d_cfg)); } RF_Free(d_cfg, sizeof(RF_DeviceConfig_t)); return retcode;