From: John L. Hammond Date: Sun, 29 Jan 2017 00:05:15 +0000 (-0500) Subject: staging: lustre: mdc: avoid returning freed request X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=59bedbccb5d27356a808f9451a3fb25adb093cc9;p=linux.git staging: lustre: mdc: avoid returning freed request In mdc_close() if ptlrpc_request_pack() fails then set req to NULL so that an already freed request is not returned in *request. Signed-off-by: John L. Hammond Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8811 Reviewed-on: https://review.whamcloud.com/23843 Reviewed-by: Patrick Farrell Reviewed-by: Andreas Dilger Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index b41f1ddf72cd4..6bc2fb8586802 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -762,6 +762,7 @@ static int mdc_close(struct obd_export *exp, struct md_op_data *op_data, rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_CLOSE); if (rc) { ptlrpc_request_free(req); + req = NULL; goto out; }