Whamcloud - gitweb
LU-9679 target: use OBD_ALLOC_PTR_ARRAY() and FREE
[fs/lustre-release.git] / lustre / target / out_handler.c
index e91c338..448de3b 100644 (file)
@@ -996,7 +996,7 @@ int out_handle(struct tgt_session_info *tsi)
        if (update_buf_count == 0)
                RETURN(err_serious(-EPROTO));
 
-       OBD_ALLOC(update_bufs, sizeof(*update_bufs) * update_buf_count);
+       OBD_ALLOC_PTR_ARRAY(update_bufs, update_buf_count);
        if (update_bufs == NULL)
                RETURN(err_serious(-ENOMEM));
 
@@ -1231,7 +1231,7 @@ out_free:
                        }
                }
 
-               OBD_FREE(update_bufs, sizeof(*update_bufs) * update_buf_count);
+               OBD_FREE_PTR_ARRAY(update_bufs, update_buf_count);
        }
 
        if (desc != NULL)