diff
if (!app_reply) {
    SET_DID_STATUS(bsg_reply->result, DID_ERROR);
    rval = -1;
+   goto out;
}

// ... (rest of the code)

out:
+ if (app_reply)
+    kfree(app_reply);
return rval;
