Print this page
kernel panic in lxpr_read_pid_env

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c
          +++ new/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c
↓ open down ↓ 1290 lines elided ↑ open up ↑
1291 1291  
1292 1292  /*
1293 1293   * lxpr_read_pid_env(): read env vector from process
1294 1294   */
1295 1295  static void
1296 1296  lxpr_read_pid_env(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
1297 1297  {
1298 1298          proc_t *p;
1299 1299          char *buf;
1300 1300          size_t asz = lxpr_maxenvvlen, sz;
     1301 +        int r;
1301 1302  
1302 1303          ASSERT(lxpnp->lxpr_type == LXPR_PID_ENV);
1303 1304  
1304 1305          buf = kmem_alloc(asz, KM_SLEEP);
1305 1306  
1306 1307          p = lxpr_lock(lxpnp->lxpr_pid);
1307 1308          if (p == NULL) {
1308 1309                  lxpr_uiobuf_seterr(uiobuf, EINVAL);
1309 1310                  kmem_free(buf, asz);
1310 1311                  return;
1311 1312          }
1312 1313  
1313      -        if (prreadenvv(p, buf, asz, &sz) != 0) {
     1314 +        r = prreadenvv(p, buf, asz, &sz);
     1315 +        lxpr_unlock(p);
     1316 +
     1317 +        if (r != 0) {
1314 1318                  lxpr_uiobuf_seterr(uiobuf, EINVAL);
1315 1319          } else {
1316 1320                  lxpr_uiobuf_write(uiobuf, buf, sz);
1317 1321          }
1318 1322  
1319      -        lxpr_unlock(p);
1320 1323          kmem_free(buf, asz);
1321 1324  }
1322 1325  
1323 1326  /*
1324 1327   * lxpr_read_pid_limits(): ulimit file
1325 1328   */
1326 1329  static void
1327 1330  lxpr_read_pid_limits(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
1328 1331  {
1329 1332          proc_t *p;
↓ open down ↓ 4889 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX