Revert "Make IEffect command more robust"

This reverts commit 38b211b610d9099c8b36464e794992cd3dd39230.

Change-Id: I5ba4d78ef761d708c8050b95974ddb77b201bb2e
diff --git a/media/libmedia/IEffect.cpp b/media/libmedia/IEffect.cpp
index dac74de..761b243 100644
--- a/media/libmedia/IEffect.cpp
+++ b/media/libmedia/IEffect.cpp
@@ -85,15 +85,13 @@
         data.writeInt32(size);
 
         status_t status = remote()->transact(COMMAND, data, &reply);
-        if (status == NO_ERROR) {
-            status = reply.readInt32();
-        }
         if (status != NO_ERROR) {
             if (pReplySize != NULL)
                 *pReplySize = 0;
             return status;
         }
 
+        status = reply.readInt32();
         size = reply.readInt32();
         if (size != 0 && pReplyData != NULL && pReplySize != NULL) {
             reply.read(pReplyData, size);
@@ -157,9 +155,6 @@
             char *cmd = NULL;
             if (cmdSize) {
                 cmd = (char *)calloc(cmdSize, 1);
-                if (cmd == NULL) { // fail the transaction
-                    return NO_MEMORY;
-                }
                 data.read(cmd, cmdSize);
             }
             uint32_t replySize = data.readInt32();
@@ -167,21 +162,15 @@
             char *resp = NULL;
             if (replySize) {
                 resp = (char *)calloc(replySize, 1);
-                if (resp == NULL) {
-                    free(cmd);
-                    return NO_MEMORY;
-                }
             }
             status_t status = command(cmdCode, cmdSize, cmd, &replySz, resp);
             reply->writeInt32(status);
-            if (status == NO_ERROR) {
-                if (replySz < replySize) {
-                    replySize = replySz;
-                }
-                reply->writeInt32(replySize);
-                if (replySize) {
-                    reply->write(resp, replySize);
-                }
+            if (replySz < replySize) {
+                replySize = replySz;
+            }
+            reply->writeInt32(replySize);
+            if (replySize) {
+                reply->write(resp, replySize);
             }
             if (cmd) {
                 free(cmd);