summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn L. Hammond <john.hammond@intel.com>2017-01-28 19:05:15 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-03 13:01:38 +0100
commit59bedbccb5d27356a808f9451a3fb25adb093cc9 (patch)
tree37af73bbd70d2e7b3bfb24ce12526a2110d1ca95
parent26d2bf1e71525f4c0f644820c30d1344633159e2 (diff)
downloadlinux-stable-59bedbccb5d27356a808f9451a3fb25adb093cc9.tar.gz
linux-stable-59bedbccb5d27356a808f9451a3fb25adb093cc9.tar.bz2
linux-stable-59bedbccb5d27356a808f9451a3fb25adb093cc9.zip
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 <john.hammond@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8811 Reviewed-on: https://review.whamcloud.com/23843 Reviewed-by: Patrick Farrell <paf@cray.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/mdc/mdc_request.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index b41f1ddf72cd..6bc2fb858680 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;
}