Loading drivers/virt/haven/hh_rm_iface.c +17 −13 Original line number Diff line number Diff line Loading @@ -986,8 +986,11 @@ EXPORT_SYMBOL(hh_rm_mem_reclaim); * * * On success, the function will return a pointer to an sg-list to convey where * the memory has been mapped. After the SG-List is no longer needed, the * caller must free the table. On a failure, a negative number will be returned. * the memory has been mapped. If the @sgl_desc parameter was not NULL, then the * return value will be a pointer to the same SG-List. Otherwise, the return * value will be a pointer to a newly allocated SG-List. After the SG-List is * no longer needed, the caller must free the table. On a failure, a negative * number will be returned. */ struct hh_sgl_desc *hh_rm_mem_accept(hh_memparcel_handle_t handle, u8 mem_type, u8 trans_type, u8 flags, hh_label_t label, Loading Loading @@ -1057,11 +1060,10 @@ struct hh_sgl_desc *hh_rm_mem_accept(hh_memparcel_handle_t handle, u8 mem_type, goto err_rm_call; } /* * TODO: Shouldn't we have an input for the number of SG entries * associated with the memparcel, so we can validate that the size of * the response buffer is what we expect? */ if (sgl_desc) { ret_sgl = sgl_desc; } else { ret_sgl = kmemdup(resp_payload, offsetof(struct hh_sgl_desc, sgl_entries[resp_payload->n_sgl_entries]), GFP_KERNEL); Loading @@ -1069,6 +1071,8 @@ struct hh_sgl_desc *hh_rm_mem_accept(hh_memparcel_handle_t handle, u8 mem_type, ret_sgl = ERR_PTR(-ENOMEM); kfree(resp_payload); } err_rm_call: kfree(req_buf); return ret_sgl; Loading Loading
drivers/virt/haven/hh_rm_iface.c +17 −13 Original line number Diff line number Diff line Loading @@ -986,8 +986,11 @@ EXPORT_SYMBOL(hh_rm_mem_reclaim); * * * On success, the function will return a pointer to an sg-list to convey where * the memory has been mapped. After the SG-List is no longer needed, the * caller must free the table. On a failure, a negative number will be returned. * the memory has been mapped. If the @sgl_desc parameter was not NULL, then the * return value will be a pointer to the same SG-List. Otherwise, the return * value will be a pointer to a newly allocated SG-List. After the SG-List is * no longer needed, the caller must free the table. On a failure, a negative * number will be returned. */ struct hh_sgl_desc *hh_rm_mem_accept(hh_memparcel_handle_t handle, u8 mem_type, u8 trans_type, u8 flags, hh_label_t label, Loading Loading @@ -1057,11 +1060,10 @@ struct hh_sgl_desc *hh_rm_mem_accept(hh_memparcel_handle_t handle, u8 mem_type, goto err_rm_call; } /* * TODO: Shouldn't we have an input for the number of SG entries * associated with the memparcel, so we can validate that the size of * the response buffer is what we expect? */ if (sgl_desc) { ret_sgl = sgl_desc; } else { ret_sgl = kmemdup(resp_payload, offsetof(struct hh_sgl_desc, sgl_entries[resp_payload->n_sgl_entries]), GFP_KERNEL); Loading @@ -1069,6 +1071,8 @@ struct hh_sgl_desc *hh_rm_mem_accept(hh_memparcel_handle_t handle, u8 mem_type, ret_sgl = ERR_PTR(-ENOMEM); kfree(resp_payload); } err_rm_call: kfree(req_buf); return ret_sgl; Loading