drbd: remove unnecessary oom message

Fixes scripts/checkpatch.pl warning:
WARNING: Possible unnecessary 'out of memory' message

Remove it can help us save a bit of memory.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Zhen Lei 2021-06-09 20:14:26 +08:00 committed by Jens Axboe
parent 76cdb09b38
commit 8404e19194
1 changed files with 6 additions and 16 deletions

View File

@ -3770,10 +3770,8 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in
} }
new_net_conf = kmalloc(sizeof(struct net_conf), GFP_KERNEL); new_net_conf = kmalloc(sizeof(struct net_conf), GFP_KERNEL);
if (!new_net_conf) { if (!new_net_conf)
drbd_err(connection, "Allocation of new net_conf failed\n");
goto disconnect; goto disconnect;
}
mutex_lock(&connection->data.mutex); mutex_lock(&connection->data.mutex);
mutex_lock(&connection->resource->conf_update); mutex_lock(&connection->resource->conf_update);
@ -4020,10 +4018,8 @@ static int receive_SyncParam(struct drbd_connection *connection, struct packet_i
if (verify_tfm || csums_tfm) { if (verify_tfm || csums_tfm) {
new_net_conf = kzalloc(sizeof(struct net_conf), GFP_KERNEL); new_net_conf = kzalloc(sizeof(struct net_conf), GFP_KERNEL);
if (!new_net_conf) { if (!new_net_conf)
drbd_err(device, "Allocation of new net_conf failed\n");
goto disconnect; goto disconnect;
}
*new_net_conf = *old_net_conf; *new_net_conf = *old_net_conf;
@ -4161,7 +4157,6 @@ static int receive_sizes(struct drbd_connection *connection, struct packet_info
new_disk_conf = kzalloc(sizeof(struct disk_conf), GFP_KERNEL); new_disk_conf = kzalloc(sizeof(struct disk_conf), GFP_KERNEL);
if (!new_disk_conf) { if (!new_disk_conf) {
drbd_err(device, "Allocation of new disk_conf failed\n");
put_ldev(device); put_ldev(device);
return -ENOMEM; return -ENOMEM;
} }
@ -4288,10 +4283,8 @@ static int receive_uuids(struct drbd_connection *connection, struct packet_info
device = peer_device->device; device = peer_device->device;
p_uuid = kmalloc_array(UI_EXTENDED_SIZE, sizeof(*p_uuid), GFP_NOIO); p_uuid = kmalloc_array(UI_EXTENDED_SIZE, sizeof(*p_uuid), GFP_NOIO);
if (!p_uuid) { if (!p_uuid)
drbd_err(device, "kmalloc of p_uuid failed\n");
return false; return false;
}
for (i = UI_CURRENT; i < UI_EXTENDED_SIZE; i++) for (i = UI_CURRENT; i < UI_EXTENDED_SIZE; i++)
p_uuid[i] = be64_to_cpu(p->uuid[i]); p_uuid[i] = be64_to_cpu(p->uuid[i]);
@ -5484,8 +5477,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
} }
peers_ch = kmalloc(pi.size, GFP_NOIO); peers_ch = kmalloc(pi.size, GFP_NOIO);
if (peers_ch == NULL) { if (!peers_ch) {
drbd_err(connection, "kmalloc of peers_ch failed\n");
rv = -1; rv = -1;
goto fail; goto fail;
} }
@ -5504,8 +5496,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
resp_size = crypto_shash_digestsize(connection->cram_hmac_tfm); resp_size = crypto_shash_digestsize(connection->cram_hmac_tfm);
response = kmalloc(resp_size, GFP_NOIO); response = kmalloc(resp_size, GFP_NOIO);
if (response == NULL) { if (!response) {
drbd_err(connection, "kmalloc of response failed\n");
rv = -1; rv = -1;
goto fail; goto fail;
} }
@ -5552,8 +5543,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
} }
right_response = kmalloc(resp_size, GFP_NOIO); right_response = kmalloc(resp_size, GFP_NOIO);
if (right_response == NULL) { if (!right_response) {
drbd_err(connection, "kmalloc of right_response failed\n");
rv = -1; rv = -1;
goto fail; goto fail;
} }