diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 7ced5a74d6..c9a0d2657d 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -161,6 +161,7 @@
[Fix] Hide profile-icon from viewtopic-page if user has no permissions (subsilver2 only) (Bug #37635 - Patch by leviatan21)
[Fix] Correct escaping/unescaping in the LDAP authentication plugin. (Bug #48175)
[Fix] Add hard limit for smilies.
+ [Fix] Remove redundant SQL query from ucp.php. (Bug #40305)
[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.
[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)
[Change] Template engine now permits to a limited extent variable includes.
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index 02b96f4bfb..b808049187 100644
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -215,11 +215,6 @@ switch ($mode)
$auth->acl_cache($user->data);
- $sql = 'UPDATE ' . USERS_TABLE . "
- SET user_perm_from = 0
- WHERE user_id = " . $user->data['user_id'];
- $db->sql_query($sql);
-
$sql = 'SELECT username
FROM ' . USERS_TABLE . '
WHERE user_id = ' . $user->data['user_perm_from'];