gsm: fix argument validation in SetAllowedMode

This commit is contained in:
Dan Williams
2010-03-22 14:56:47 -07:00
parent 6ab36bacf3
commit 282ba6561e
+3 -3
View File
@@ -540,11 +540,11 @@ impl_gsm_modem_set_allowed_mode (MMModemGsmNetwork *modem,
MMModemGsmAllowedMode mode,
DBusGMethodInvocation *context)
{
if (!check_for_single_value (mode)) {
if (mode > MM_MODEM_GSM_ALLOWED_MODE_LAST) {
GError *error;
error = g_error_new_literal (MM_MODEM_ERROR, MM_MODEM_ERROR_OPERATION_NOT_SUPPORTED,
"Invalid arguments (more than one value given)");
error = g_error_new (MM_MODEM_ERROR, MM_MODEM_ERROR_OPERATION_NOT_SUPPORTED,
"Unknown allowed mode %d", mode);
dbus_g_method_return_error (context, error);
g_error_free (error);
return;